Skip to content

Commit

Permalink
fix pressure in input
Browse files Browse the repository at this point in the history
  • Loading branch information
srmnitc committed Sep 29, 2023
1 parent 377a4d8 commit 82700ee
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions calphy/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,27 +214,27 @@ def _validate_pressure(self) -> 'Input':
elif np.shape(self.pressure) == (1,):
self._iso = True
self._fix_lattice = False
self._pressure = self.pressure_input[0]
self._pressure_stop = self.pressure_input[0]
self._pressure = self.pressure[0]
self._pressure_stop = self.pressure[0]
elif np.shape(self.pressure) == (2,):
self._iso = True
self._fix_lattice = False
self._pressure = self.pressure_input[0]
self._pressure_stop = self.pressure_input[1]
self._pressure = self.pressure[0]
self._pressure_stop = self.pressure[1]
elif np.shape(self.pressure) == (1, 3):
if not _check_equal(self.pressure[0]):
raise ValueError('All pressure terms must be equal')
self._iso = False
self._fix_lattice = False
self._pressure = self.pressure_input[0][0]
self._pressure_stop = self.pressure_input[0][0]
self._pressure = self.pressure[0][0]
self._pressure_stop = self.pressure[0][0]
elif np.shape(self.pressure) == (2, 3):
if not (_check_equal(self.pressure[0]) and _check_equal(self.pressure[1])):
raise ValueError('All pressure terms must be equal')
self._iso = False
self._fix_lattice = False
self._pressure = self.pressure_input[0][0]
self._pressure_stop = self.pressure_input[1][0]
self._pressure = self.pressure[0][0]
self._pressure_stop = self.pressure[1][0]
else:
raise ValueError('Unknown format for pressure')
return self
Expand Down

0 comments on commit 82700ee

Please sign in to comment.