Skip to content

Commit 3c0dca6

Browse files
authored
Merge branch 'main' into improve_auto_cut
2 parents 1d6f7d8 + a4cbbf8 commit 3c0dca6

2 files changed

Lines changed: 27 additions & 7 deletions

File tree

environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# made dependency list more explicit (@JacksonBurns).
1717
# - October 16, 2023 Switched RDKit and descripatastorus to conda-forge,
1818
# moved diffeqpy to pip and (temporarily) removed chemprop
19-
#
19+
# - August 4, 2024 Restricted pyrms to <2
2020
name: rmg_env
2121
channels:
2222
- defaults
@@ -88,7 +88,7 @@ dependencies:
8888
# packages we maintain
8989
- rmg::pydas >=1.0.3
9090
- rmg::pydqed >=1.0.3
91-
- rmg::pyrms
91+
- rmg::pyrms <2
9292
- rmg::symmetry
9393

9494
# packages we would like to stop maintaining (and why)

rmgpy/molecule/draw.py

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,6 +1644,7 @@ def __init__(self, options=None):
16441644
self.options = MoleculeDrawer().options.copy()
16451645
self.options.update({
16461646
'arrowLength': 36,
1647+
'drawReversibleArrow': True
16471648
})
16481649
if options:
16491650
self.options.update(options)
@@ -1744,11 +1745,30 @@ def draw(self, reaction, file_format, path=None):
17441745
rxn_cr.save()
17451746
rxn_cr.set_source_rgba(0.0, 0.0, 0.0, 1.0)
17461747
rxn_cr.set_line_width(1.0)
1747-
rxn_cr.move_to(rxn_x + 8, rxn_top + 0.5 * rxn_height)
1748-
rxn_cr.line_to(rxn_x + arrow_width - 8, rxn_top + 0.5 * rxn_height)
1749-
rxn_cr.move_to(rxn_x + arrow_width - 14, rxn_top + 0.5 * rxn_height - 3.0)
1750-
rxn_cr.line_to(rxn_x + arrow_width - 8, rxn_top + 0.5 * rxn_height)
1751-
rxn_cr.line_to(rxn_x + arrow_width - 14, rxn_top + 0.5 * rxn_height + 3.0)
1748+
if self.options['drawReversibleArrow'] and reaction.reversible: # draw double harpoons
1749+
TOP_HARPOON_Y = rxn_top + (0.5 * rxn_height - 1.75)
1750+
BOTTOM_HARPOON_Y = rxn_top + (0.5 * rxn_height + 1.75)
1751+
1752+
# Draw top harpoon
1753+
rxn_cr.move_to(rxn_x + 8, TOP_HARPOON_Y)
1754+
rxn_cr.line_to(rxn_x + arrow_width - 8, TOP_HARPOON_Y)
1755+
rxn_cr.move_to(rxn_x + arrow_width - 14, TOP_HARPOON_Y - 3.0)
1756+
rxn_cr.line_to(rxn_x + arrow_width - 8, TOP_HARPOON_Y)
1757+
1758+
# Draw bottom harpoon
1759+
rxn_cr.move_to(rxn_x + arrow_width - 8, BOTTOM_HARPOON_Y)
1760+
rxn_cr.line_to(rxn_x + 8, BOTTOM_HARPOON_Y)
1761+
rxn_cr.move_to(rxn_x + 14, BOTTOM_HARPOON_Y + 3.0)
1762+
rxn_cr.line_to(rxn_x + 8, BOTTOM_HARPOON_Y)
1763+
1764+
1765+
else: # draw forward arrow
1766+
rxn_cr.move_to(rxn_x + 8, rxn_top + 0.5 * rxn_height)
1767+
rxn_cr.line_to(rxn_x + arrow_width - 8, rxn_top + 0.5 * rxn_height)
1768+
rxn_cr.move_to(rxn_x + arrow_width - 14, rxn_top + 0.5 * rxn_height - 3.0)
1769+
rxn_cr.line_to(rxn_x + arrow_width - 8, rxn_top + 0.5 * rxn_height)
1770+
rxn_cr.line_to(rxn_x + arrow_width - 14, rxn_top + 0.5 * rxn_height + 3.0)
1771+
17521772
rxn_cr.stroke()
17531773
rxn_cr.restore()
17541774
rxn_x += arrow_width

0 commit comments

Comments
 (0)