-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
503 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from ...exceptions import ArgumentError | ||
|
||
def digest_file(file, caller=None): | ||
|
||
if caller.endswith('write_topology_in_msmh5'): | ||
|
||
from h5py._hl.files import File as h5py_File | ||
from molsysmt.native import MSMH5FileHandler | ||
|
||
if isinstance(file, h5py_File): | ||
if 'type' in file.attrs: | ||
return file | ||
|
||
elif isinstance(file, MSMH5FileHandler): | ||
return file | ||
|
||
else: | ||
|
||
from molsysmt.form.file_msmh5.is_form import is_form as is_file_msmh5_form | ||
file_is_msmh5 = is_file_msmh5_form(file) | ||
if file_is_msmh5: | ||
return file | ||
|
||
|
||
raise ArgumentError('file', value=file, caller=caller, message=None) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
def is_form(item): | ||
|
||
item_fullname = item.__class__.__module__+'.'+item.__class__.__name__ | ||
from openmm.app.simulation import Simulation | ||
|
||
return 'openmm.Simulation'==item_fullname | ||
return isinstance(item, Simulation) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from molsysmt._private.digestion import digest | ||
|
||
@digest(form='openmm.Simulation') | ||
def to_file_msmpk(item, atom_indices='all', structure_indices='all', output_filename=None): | ||
|
||
from . import to_molsysmt_MolSys as openmm_Simulation_to_molsysmt_MolSys | ||
from ..molsysmt_MolSys import to_file_msmpk as molsysmt_MolSys_to_file_msmpk | ||
|
||
tmp_item = openmm_Simulation_to_molsysmt_MolSys(item, atom_indices=atom_indices, | ||
structure_indices=structure_indices) | ||
|
||
tmp_item = molsysmt_MolSys_to_file_msmpk(tmp_item, output_filename=output_filename) | ||
|
||
return tmp_item | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from molsysmt._private.digestion import digest | ||
|
||
@digest(form='openmm.Topology') | ||
def write_topology_in_msmh5(item, file, atom_indices='all'): | ||
|
||
from . import to_molsysmt_Topology as openmm_Topology_to_molsysmt_Topology | ||
from ..molsysmt_Topology import write_topology_in_msmh5 as write_molsysmt_Topology_in_msmh5 | ||
|
||
molsysmt_Topology = openmm_Topology_to_molsysmt_Topology(item, atom_indices=atom_indices) | ||
write_molsysmt_Topology_in_msmh5(molsysmt_Topology, file) | ||
|
||
pass | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.