Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #124 #125

Merged
merged 3 commits into from
Jul 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/devel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
max-parallel: 9
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
platform:
- { name: "windows", os: "windows-latest", shell: "pwsh" }
- { name: "linux", os: "ubuntu-latest", shell: "bash -l {0}" }
Expand All @@ -22,14 +22,14 @@ jobs:
# Exclude all but the latest Python from all but Linux
- platform:
{ name: "macos", os: "macos-latest", shell: "bash -l {0}" }
python-version: "3.8"
python-version: "3.9"
- platform: { name: "windows", os: "windows-latest", shell: "pwsh" }
python-version: "3.8"
python-version: "3.9"
- platform:
{ name: "macos", os: "macos-latest", shell: "bash -l {0}" }
python-version: "3.9"
python-version: "3.10"
- platform: { name: "windows", os: "windows-latest", shell: "pwsh" }
python-version: "3.9"
python-version: "3.10"
environment:
name: biosimspace-build
defaults:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
max-parallel: 9
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
platform:
- { name: "windows", os: "windows-latest", shell: "pwsh" }
- { name: "linux", os: "ubuntu-latest", shell: "bash -l {0}" }
Expand All @@ -22,14 +22,14 @@ jobs:
# but Linux
- platform:
{ name: "macos", os: "macos-latest", shell: "bash -l {0}" }
python-version: "3.8"
python-version: "3.9"
- platform: { name: "windows", os: "windows-latest", shell: "pwsh" }
python-version: "3.8"
python-version: "3.9"
- platform:
{ name: "macos", os: "macos-latest", shell: "bash -l {0}" }
python-version: "3.9"
python-version: "3.10"
- platform: { name: "windows", os: "windows-latest", shell: "pwsh" }
python-version: "3.9"
python-version: "3.10"
environment:
name: biosimspace-build
defaults:
Expand Down
13 changes: 9 additions & 4 deletions python/BioSimSpace/Process/_gromacs.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,15 @@ def _generate_config(self):
"""Generate GROMACS configuration file strings."""

# Check whether the system contains periodic box information.
# For now, well not attempt to generate a box if the system property
# is missing. If no box is present, we'll assume a non-periodic simulation.
if "space" in self._system._sire_object.propertyKeys():
has_box = True
space_prop = self._property_map.get("space", "space")
if space_prop in self._system._sire_object.propertyKeys():
try:
# Make sure that we have a periodic box. The system will now have
# a default cartesian space.
box = self._system._sire_object.property(space_prop)
has_box = box.isPeriodic()
except:
has_box = False
else:
_warnings.warn("No simulation box found. Assuming gas phase simulation.")
has_box = False
Expand Down
10 changes: 7 additions & 3 deletions python/BioSimSpace/Process/_openmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,14 @@ def _generate_config(self):
prop = self._property_map.get("space", "space")

# Check whether the system contains periodic box information.
# For now, we'll not attempt to generate a box if the system property
# is missing. If no box is present, we'll assume a non-periodic simulation.
if prop in self._system._sire_object.propertyKeys():
has_box = True
try:
# Make sure that we have a periodic box. The system will now have
# a default cartesian space.
box = self._system._sire_object.property(prop)
has_box = box.isPeriodic()
except:
has_box = False
else:
_warnings.warn("No simulation box found. Assuming gas phase simulation.")
has_box = False
Expand Down
8 changes: 7 additions & 1 deletion python/BioSimSpace/Sandpit/Exscientia/Process/_openmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,13 @@ def _generate_config(self):
# For now, we'll not attempt to generate a box if the system property
# is missing. If no box is present, we'll assume a non-periodic simulation.
if prop in self._system._sire_object.propertyKeys():
has_box = True
try:
# Make sure that we have a periodic box. The system will now have
# a default cartesian space.
box = self._system._sire_object.property(prop)
has_box = box.isPeriodic()
except:
has_box = False
else:
_warnings.warn("No simulation box found. Assuming gas phase simulation.")
has_box = False
Expand Down
8 changes: 7 additions & 1 deletion python/BioSimSpace/Sandpit/Exscientia/Protocol/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ def __init__(self, system, protocol, explicit_dummies=False):
def _has_box(self):
"""Return whether the current system has a box."""
if "space" in self.system._sire_object.propertyKeys():
has_box = True
try:
# Make sure that we have a periodic box. The system will now have
# a default cartesian space.
box = self.system._sire_object.property("space")
has_box = box.isPeriodic()
except:
has_box = False
else:
_warnings.warn("No simulation box found. Assuming gas phase simulation.")
has_box = False
Expand Down
12 changes: 10 additions & 2 deletions python/BioSimSpace/_Config/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,18 @@ def hasBox(self):
"""
space_prop = self._property_map.get("space", "space")
if space_prop in self._system._sire_object.propertyKeys():
return True
try:
# Make sure that we have a periodic box. The system will now have
# a default cartesian space.
box = self._system._sire_object.property(space_prop)
has_box = box.isPeriodic()
except:
has_box = False
else:
has_box = False
_warnings.warn("No simulation box found. Assuming gas phase simulation.")
return False

return has_box

def hasWater(self):
"""
Expand Down