Skip to content

Commit

Permalink
update input
Browse files Browse the repository at this point in the history
  • Loading branch information
srmnitc committed Apr 1, 2022
1 parent d127d6d commit 5339a6f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 5 additions & 3 deletions calphy/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ def pressure(self):

@pressure.setter
def pressure(self, val):
print("im here")
print(val)
self._pressure_input = val
if val is None:
self._fix_lattice = True
Expand All @@ -183,7 +185,7 @@ def pressure(self, val):
self._iso = False
else:
raise NotImplementedError()
elif len(value) == 2:
elif len(val) == 2:
self._pressure = val[0]
self._pressure_stop = val[1]
else:
Expand Down Expand Up @@ -467,8 +469,8 @@ def read_inputfile(file):
calc = Calculation.generate(indata)
calc.from_dict(ci, keys=["mode", "pair_style", "pair_coeff", "repeat", "n_equilibration_steps",
"n_switching_steps", "n_print_steps", "n_iterations"])
calc.pressure = Calculation.convert_to_list(ci["pressure"]) if "pressure" in ci.keys() else []
calc.temperature = Calculation.convert_to_list(ci["temperature"]) if "temperature" in ci.keys() else []
calc.pressure = Calculation.convert_to_list(ci["pressure"]) if "pressure" in ci.keys() else 0
calc.temperature = Calculation.convert_to_list(ci["temperature"]) if "temperature" in ci.keys() else None
calc.lattice = Calculation.convert_to_list(ci["lattice"]) if "lattice" in ci.keys() else None
calc.reference_phase = Calculation.convert_to_list(ci["reference_phase"]) if "reference_phase" in ci.keys() else None
calc.lattice_constant = Calculation.convert_to_list(ci["lattice_constant"]) if "lattice_constant" in ci.keys() else 0
Expand Down
12 changes: 11 additions & 1 deletion notebooks/running_from_notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,24 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 6,
"id": "314f0ed3-e40c-4b2d-a142-e70758d9a790",
"metadata": {},
"outputs": [],
"source": [
"csol = Calculation()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "379918d5-0f64-4779-aa75-6df2d29a7556",
"metadata": {},
"outputs": [],
"source": [
"csol."
]
},
{
"cell_type": "code",
"execution_count": 4,
Expand Down

0 comments on commit 5339a6f

Please sign in to comment.