Skip to content

Commit

Permalink
Merge pull request #171 from pyscal/add_simx
Browse files Browse the repository at this point in the history
add simcell dims
  • Loading branch information
srmnitc authored Jan 17, 2025
2 parents 4fff311 + e6fb4b6 commit 1bf4e96
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions atomrdf/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def __init__(self, name, sample_id, graph):
'SimulationCellVolume': self._volume,
'NumberOfAtoms': self._no_of_atoms,
'SimulationCellLengths': self._simulation_cell_lengths,
'SimulationCellLengthX': self._simulation_cell_length_x,
'SimulationCellLengthY': self._simulation_cell_length_y,
'SimulationCellLengthZ': self._simulation_cell_length_z
}
self.properties._add_attribute(mapdict)

Expand Down Expand Up @@ -99,6 +102,27 @@ def _simulation_cell_lengths(self):
y = self._graph.value(simcelllength, CMSO.hasLength_y).toPython()
z = self._graph.value(simcelllength, CMSO.hasLength_z).toPython()
return Property([x, y, z], graph=self._graph, parent=simcelllength, sample_parent=self._sample_id)

@property
def _simulation_cell_length_x(self):
simcell = self._graph.value(self._sample_id, CMSO.hasSimulationCell)
simcelllength = self._graph.value(simcell, CMSO.hasLength)
x = self._graph.value(simcelllength, CMSO.hasLength_x).toPython()
return Property(x, graph=self._graph, parent=simcelllength, sample_parent=self._sample_id)

@property
def _simulation_cell_length_y(self):
simcell = self._graph.value(self._sample_id, CMSO.hasSimulationCell)
simcelllength = self._graph.value(simcell, CMSO.hasLength)
y = self._graph.value(simcelllength, CMSO.hasLength_y).toPython()
return Property(y, graph=self._graph, parent=simcelllength, sample_parent=self._sample_id)

@property
def _simulation_cell_length_z(self):
simcell = self._graph.value(self._sample_id, CMSO.hasSimulationCell)
simcelllength = self._graph.value(simcell, CMSO.hasLength)
z = self._graph.value(simcelllength, CMSO.hasLength_z).toPython()
return Property(z, graph=self._graph, parent=simcelllength, sample_parent=self._sample_id)

@property
def _input_properties(self):
Expand Down

0 comments on commit 1bf4e96

Please sign in to comment.