Skip to content

Commit

Permalink
all classes are condensed
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Jan 5, 2024
1 parent 9a98d35 commit 59a49ae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
10 changes: 6 additions & 4 deletions atomistics/shared/thermal_expansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ def __init__(self, temperatures_lst, volumes_lst):
self._temperatures_lst = temperatures_lst
self._volumes_lst = volumes_lst

def get_volumes(self):
def volumes(self):
return self._volumes_lst

def get_temperatures(self):
def temperatures(self):
return self._temperatures_lst


OutputThermalExpansionProperties = OutputThermalExpansion(
temperatures=ThermalExpansionProperties.get_temperatures,
volumes=ThermalExpansionProperties.get_volumes,
**{
k: getattr(ThermalExpansionProperties, k)
for k in OutputThermalExpansion.fields()
}
)
25 changes: 11 additions & 14 deletions atomistics/workflows/evcurve/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,25 +101,25 @@ class EnergyVolumeCurveProperties:
def __init__(self, fit_module):
self._fit_module = fit_module

def get_volume_eq(self):
def volume_eq(self):
return self._fit_module.fit_dict["volume_eq"]

def get_energy_eq(self):
def energy_eq(self):
return self._fit_module.fit_dict["energy_eq"]

def get_bulkmodul_eq(self):
def bulkmodul_eq(self):
return self._fit_module.fit_dict["bulkmodul_eq"]

def get_bulkmodul_pressure_derivative_eq(self):
def b_prime_eq(self):
return self._fit_module.fit_dict["b_prime_eq"]

def get_volumes(self):
def volume(self):
return self._fit_module.fit_dict["volume"]

def get_energies(self):
def energy(self):
return self._fit_module.fit_dict["energy"]

def get_fit_dict(self):
def fit_dict(self):
return {
k: self._fit_module.fit_dict[k]
for k in ["fit_type", "least_square_error", "poly_fit", "fit_order"]
Expand All @@ -128,13 +128,10 @@ def get_fit_dict(self):


EnergyVolumeCurveOutputEnergyVolumeCurve = OutputEnergyVolumeCurve(
fit_dict=EnergyVolumeCurveProperties.get_fit_dict,
energy=EnergyVolumeCurveProperties.get_energies,
volume=EnergyVolumeCurveProperties.get_volumes,
b_prime_eq=EnergyVolumeCurveProperties.get_bulkmodul_pressure_derivative_eq,
bulkmodul_eq=EnergyVolumeCurveProperties.get_bulkmodul_eq,
energy_eq=EnergyVolumeCurveProperties.get_energy_eq,
volume_eq=EnergyVolumeCurveProperties.get_volume_eq,
**{
k: getattr(EnergyVolumeCurveProperties, k)
for k in OutputEnergyVolumeCurve.fields()
}
)


Expand Down

0 comments on commit 59a49ae

Please sign in to comment.