Skip to content

Commit

Permalink
Convert pressure always to array
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrv committed Sep 12, 2022
1 parent b4443bf commit 4179764
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pyiron_atomistics/interactive/scipy_minimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def run_static(self):
self.ref_job.run(delete_existing_job=self._delete_existing_job)
self.status.running = True
if self.input.pressure is not None:
x0 = np.zeros(sum(np.asarray(self.input.pressure) != None))
x0 = np.zeros(sum(self.input.pressure != None))
if not self.input.volume_only:
x0 = np.append(
x0, self.ref_job.structure.get_scaled_positions().flatten()
Expand Down Expand Up @@ -350,9 +350,12 @@ def pressure_tolerance(self, value: float):
self.storage.pressure_tolerance = value

@property
def pressure(self) -> List[float]:
def pressure(self):
"""float: target pressure"""
return self.storage.pressure
if isinstance(self.storage.pressure, Iterable):
return np.asarray(self.storage.pressure)
else:
return self.storage.pressure

@pressure.setter
def pressure(self, value: Iterable[float]):
Expand Down

0 comments on commit 4179764

Please sign in to comment.