Skip to content

Commit 772c0df

Browse files
authored
Merge branch 'main' into pdep_spin_conservation
2 parents 9fdc594 + a4cbbf8 commit 772c0df

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

arkane/ess/adapter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ class ESSAdapter(ABC):
4545
An abstract ESS Adapter class
4646
"""
4747

48-
def __init__(self, path, check_for_errors=True):
48+
def __init__(self, path, check_for_errors=True, scratch_directory=None):
4949
self.path = path
5050
if check_for_errors:
5151
self.check_for_errors()
52+
self.scratch_directory = scratch_directory if scratch_directory is not None else os.path.join(os.path.abspath('.'), str('scratch'))
5253

5354
@abstractmethod
5455
def check_for_errors(self):
@@ -174,7 +175,7 @@ def get_symmetry_properties(self):
174175
coordinates, atom_numbers, _ = self.load_geometry()
175176
unique_id = '0' # Just some name that the SYMMETRY code gives to one of its jobs
176177
# Scratch directory that the SYMMETRY code writes its files in:
177-
scr_dir = os.path.join(os.path.abspath('.'), str('scratch'))
178+
scr_dir = self.scratch_directory
178179
if not os.path.exists(scr_dir):
179180
os.makedirs(scr_dir)
180181
try:

arkane/ess/factory.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def register_ess_adapter(ess: str,
6161

6262
def ess_factory(fullpath: str,
6363
check_for_errors: bool = True,
64+
scratch_directory: str = None,
6465
) -> Type[ESSAdapter]:
6566
"""
6667
A factory generating the ESS adapter corresponding to ``ess_adapter``.
@@ -106,4 +107,4 @@ def ess_factory(fullpath: str,
106107
raise InputError(f'The file at {fullpath} could not be identified as a '
107108
f'Gaussian, Molpro, Orca, Psi4, QChem, or TeraChem log file.')
108109

109-
return _registered_ess_adapters[ess_name](path=fullpath, check_for_errors=check_for_errors)
110+
return _registered_ess_adapters[ess_name](path=fullpath, check_for_errors=check_for_errors, scratch_directory=scratch_directory)

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)