-
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
62 changed files
with
5,069 additions
and
92 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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.8.3+17.gcda3efaf.dirty" | ||
__version__ = "0.8.3+19.g38a19d1b.dirty" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from molsysmt._private.digestion import digest | ||
|
||
@digest(form='file:msmh5') | ||
def to_molsysmt_MolSysNEW(item, atom_indices='all', structure_indices='all'): | ||
|
||
from . import to_molsysmt_MSMH5FileHandler | ||
from ..molsysmt_MSMH5FileHandler import to_molsysmt_MolSysNEW as molsysmt_MSMH5FileHandler_to_molsysmt_MolSys | ||
|
||
handler = to_molsysmt_MSMH5FileHandler(item) | ||
tmp_item = molsysmt_MSMH5FileHandler_to_molsysmt_MolSysNEW(handler, atom_indices=atom_indices, | ||
structure_indices=structure_indices) | ||
handler.close() | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from molsysmt._private.digestion import digest | ||
|
||
@digest(form='file:msmh5') | ||
def to_molsysmt_StructuresNEW(item, atom_indices='all', structure_indices='all'): | ||
|
||
from . import to_molsysmt_MSMH5FileHandler | ||
from ..molsysmt_MSMH5FileHandler import to_molsysmt_StructuresNEW as molsysmt_MSMH5FileHandler_to_molsysmt_StructuresNEW | ||
|
||
handler = to_molsysmt_MSMH5FileHandler(item) | ||
tmp_item = molsysmt_MSMH5FileHandler_to_molsysmt_StructuresNEW(handler, atom_indices=atom_indices, | ||
structure_indices=structure_indices) | ||
handler.close() | ||
|
||
return tmp_item |
6 changes: 3 additions & 3 deletions
6
.../form/file_msmh5/to_molsysmt_Topology2.py → ...orm/file_msmh5/to_molsysmt_TopologyNEW.py
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,13 +1,13 @@ | ||
from molsysmt._private.digestion import digest | ||
|
||
@digest(form='file:msmh5') | ||
def to_molsysmt_Topology2(item, atom_indices='all'): | ||
def to_molsysmt_TopologyNEW(item, atom_indices='all'): | ||
|
||
from . import to_molsysmt_MSMH5FileHandler | ||
from ..molsysmt_MSMH5FileHandler import to_molsysmt_Topology2 as molsysmt_MSMH5FileHandler_to_molsysmt_Topology2 | ||
from ..molsysmt_MSMH5FileHandler import to_molsysmt_TopologyNEW as molsysmt_MSMH5FileHandler_to_molsysmt_TopologyNEW | ||
|
||
handler = to_molsysmt_MSMH5FileHandler(item) | ||
tmp_item = molsysmt_MSMH5FileHandler_to_molsysmt_Topology2(handler, atom_indices=atom_indices) | ||
tmp_item = molsysmt_MSMH5FileHandler_to_molsysmt_TopologyNEW(handler, atom_indices=atom_indices) | ||
handler.close() | ||
|
||
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
15 changes: 15 additions & 0 deletions
15
molsysmt/form/molsysmt_MSMH5FileHandler/to_molsysmt_MolSysNEW.py
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='molsysmt.MSMH5FileHandler') | ||
def to_molsysmt_MolSysNEW(item, atom_indices='all', structure_indices='all'): | ||
|
||
from .to_molsysmt_TopologyNEW import to_molsysmt_TopologyNEW | ||
from .to_molsysmt_StructuresNEW import to_molsysmt_StructuresNEW | ||
from molsysmt.native import MolSysNEW | ||
|
||
tmp_item = MolSysNEW() | ||
tmp_item.topology = to_molsysmt_TopologyNEW(item, atom_indices=atom_indices) | ||
tmp_item.structures = to_molsysmt_StructuresNEW(item, atom_indices=atom_indices, structure_indices=structure_indices) | ||
|
||
return tmp_item | ||
|
110 changes: 110 additions & 0 deletions
110
molsysmt/form/molsysmt_MSMH5FileHandler/to_molsysmt_StructuresNEW.py
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,110 @@ | ||
from molsysmt._private.digestion import digest | ||
from molsysmt import pyunitwizard as puw | ||
import numpy as np | ||
|
||
@digest(form='molsysmt.MSMH5FileHandler') | ||
def to_molsysmt_StructuresNEW(item, atom_indices='all', structure_indices='all'): | ||
|
||
from molsysmt.native import StructuresNEW | ||
|
||
structures_ds = item.file['structures'] | ||
|
||
n_atoms = structures_ds.attrs['n_atoms'] | ||
n_structures = structures_ds.attrs['n_structures'] | ||
|
||
length_unit = puw.unit(structures_ds.attrs['length_unit']) | ||
time_unit = puw.unit(structures_ds.attrs['time_unit']) | ||
energy_unit = puw.unit(structures_ds.attrs['energy_unit']) | ||
temperature_unit = puw.unit(structures_ds.attrs['temperature_unit']) | ||
|
||
standard_length_unit = puw.get_standard_units(length_unit) | ||
standard_time_unit = puw.get_standard_units(time_unit) | ||
standard_energy_unit = puw.get_standard_units(energy_unit) | ||
standard_temperature_unit = puw.get_standard_units(temperature_unit) | ||
|
||
tmp_item = StructuresNEW() | ||
|
||
tmp_item.n_atoms = n_atoms | ||
tmp_item.n_structures = n_structures | ||
|
||
# Coordinates | ||
|
||
if structures_ds['coordinates'].shape[0]>0: | ||
|
||
tmp_item.coordinates = puw.quantity(np.zeros([n_structures, n_atoms, 3], dtype='float64'), | ||
standard_length_unit) | ||
tmp_item.coordinates[:,:,:] = puw.quantity(structures_ds['coordinates'][:,:,:], | ||
length_unit) | ||
|
||
else: | ||
|
||
tmp_item.coordinates = None | ||
|
||
# Velocities | ||
|
||
if structures_ds['velocities'].shape[0]>0: | ||
|
||
tmp_item.velocities = puw.quantity(np.zeros([n_structures, n_atoms, 3], dtype='float64'), | ||
standard_length_unit/standard_time_unit) | ||
tmp_item.velocities[:,:,:] = puw.quantity(structures_ds['velocities'][:,:,:], | ||
length_unit/time_unit) | ||
|
||
else: | ||
|
||
tmp_item.velocities = None | ||
|
||
# Box | ||
|
||
if structures_ds['box'].shape[0]>0: | ||
|
||
tmp_item.box = puw.quantity(np.zeros([n_structures, 3, 3], dtype='float64'), | ||
standard_length_unit) | ||
tmp_item.box[:,:,:] = puw.quantity(structures_ds['box'][:,:,:], | ||
length_unit) | ||
|
||
else: | ||
|
||
tmp_item.box = None | ||
|
||
# Kinetic Energy | ||
|
||
if structures_ds['kinetic_energy'].shape[0]>0: | ||
|
||
tmp_item.kinetic_energy = puw.quantity(np.zeros([n_structures], dtype='float64'), | ||
standard_energy_unit) | ||
tmp_item.kinetic_energy[:] = puw.quantity(structures_ds['kinetic_energy'][:], | ||
energy_unit) | ||
|
||
else: | ||
|
||
tmp_item.kinetic_energy = None | ||
|
||
# Potential Energy | ||
|
||
if structures_ds['potential_energy'].shape[0]>0: | ||
|
||
tmp_item.potential_energy = puw.quantity(np.zeros([n_structures], dtype='float64'), | ||
standard_energy_unit) | ||
tmp_item.potential_energy[:] = puw.quantity(structures_ds['potential_energy'][:], | ||
energy_unit) | ||
|
||
else: | ||
|
||
tmp_item.potential_energy = None | ||
|
||
# Temperature | ||
|
||
if structures_ds['temperature'].shape[0]>0: | ||
|
||
tmp_item.temperature = puw.quantity(np.zeros([n_structures], dtype='float64'), | ||
standard_temperature_unit) | ||
tmp_item.temperature[:] = puw.quantity(structures_ds['temperature'][:], | ||
temperature_unit) | ||
|
||
else: | ||
|
||
tmp_item.temperature = None | ||
|
||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
form_name = 'molsysmt.MolSysNEW' | ||
form_type = 'class' | ||
form_info = ["", ""] | ||
|
||
from .is_form import is_form | ||
|
||
from .attributes import attributes | ||
from .has_attribute import has_attribute | ||
|
||
from .extract import extract | ||
from .copy import copy | ||
from .add import add | ||
from .merge import merge | ||
from .append_structures import append_structures | ||
from .get import * | ||
from .set import * | ||
from .iterators import StructuresIterator, TopologyIterator | ||
|
||
from .to_molsysmt_TopologyNEW import to_molsysmt_TopologyNEW | ||
from .to_molsysmt_StructuresNEW import to_molsysmt_StructuresNEW | ||
from .to_molsysmt_MolecularMechanics import to_molsysmt_MolecularMechanics | ||
from .to_molsysmt_MolecularMechanicsDict import to_molsysmt_MolecularMechanicsDict | ||
from .to_file_msmpk import to_file_msmpk | ||
|
||
_convert_to={ | ||
'molsysmt.MolSysNEW': extract, | ||
'molsysmt.TopologyNEW': to_molsysmt_TopologyNEW, | ||
'molsysmt.StructuresNEW': to_molsysmt_StructuresNEW, | ||
'molsysmt.MolecularMechanics': to_molsysmt_MolecularMechanics, | ||
'molsysmt.MolecularMechanicsDict': to_molsysmt_MolecularMechanicsDict, | ||
'file:msmpk': to_file_msmpk, | ||
} | ||
|
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,12 @@ | ||
from molsysmt._private.exceptions import NotImplementedMethodError | ||
from molsysmt._private.digestion import digest | ||
from molsysmt import pyunitwizard as puw | ||
import numpy as np | ||
|
||
@digest(form='molsysmt.MolSysNEW', to_form='molsysmt.MolSysNEW') | ||
def add(to_item, item, atom_indices='all', structure_indices='all'): | ||
|
||
to_item.add(item) | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from molsysmt._private.exceptions import NotImplementedMethodError | ||
from molsysmt._private.digestion import digest | ||
|
||
@digest(form='molsysmt.MolSysNEW') | ||
def append_structures(item, structure_id=None, time=None, coordinates=None, velocities=None, | ||
box=None): | ||
|
||
item.structures.append_structures(structure_id=structure_id, time=time, coordinates=coordinates, | ||
velocities=velocities, box=box) | ||
|
||
pass | ||
|
Oops, something went wrong.