Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace dataclass by abstract class #176

Draft
wants to merge 37 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f5aeeef
Define the generic format in a separate file
jan-janssen Jan 5, 2024
c4f5197
fix bug
jan-janssen Jan 5, 2024
8f84cbe
make_output_dataclass()
jan-janssen Jan 5, 2024
7a5bc1a
black formating
jan-janssen Jan 5, 2024
51462e2
no more dataclass
jan-janssen Jan 5, 2024
a3919d0
Initialize dataclass only shortly before usage
jan-janssen Jan 5, 2024
f2f6edb
Fix LAMMPS bug
jan-janssen Jan 5, 2024
c70d2ed
define function calls directly
jan-janssen Jan 5, 2024
cc938b4
refactor get call
jan-janssen Jan 5, 2024
919e34d
Format black
pyiron-runner Jan 5, 2024
b6296d6
Merge remote-tracking branch 'origin/condense_vol_two' into generic_f…
jan-janssen Jan 5, 2024
d0fefe3
Merge remote-tracking branch 'origin/main' into generic_format
jan-janssen Jan 5, 2024
ffcd881
Replace dataclass by abstract class
jan-janssen Jan 5, 2024
33a183b
fix phonon jobs
jan-janssen Jan 5, 2024
de46f34
fit energy volume curve
jan-janssen Jan 5, 2024
aeae541
more fixes
jan-janssen Jan 5, 2024
6d2e837
return tuple from get_keys()
jan-janssen Jan 5, 2024
1acb557
Format black
pyiron-runner Jan 5, 2024
bbd6e99
fix thermal expasion
jan-janssen Jan 5, 2024
eea1e4c
Merge remote-tracking branch 'origin/abstract_class' into abstract_class
jan-janssen Jan 5, 2024
9cd9cb9
fix coverage
jan-janssen Jan 5, 2024
ab97e6c
fix function list
jan-janssen Jan 5, 2024
ddcf101
be more explicit
jan-janssen Jan 6, 2024
a6b774f
black formatting
jan-janssen Jan 6, 2024
0665c4d
rename output parameter to output_keys
jan-janssen Jan 6, 2024
fc12349
Update output.py
jan-janssen Jan 6, 2024
f100af0
fix test
jan-janssen Jan 6, 2024
cb2c5c6
fix signature test
jan-janssen Jan 6, 2024
c23292a
use type hints in abstract class
jan-janssen Jan 6, 2024
7650963
Merge remote-tracking branch 'origin/main' into abstract_class
jan-janssen Jan 6, 2024
2b2681c
updates
jan-janssen Jan 6, 2024
c183384
introduce output properties and rename output classes
jan-janssen Jan 7, 2024
d390579
Format black
pyiron-runner Jan 7, 2024
d0f55ed
fix test
jan-janssen Jan 7, 2024
803c889
Add Docstrings to output class
jan-janssen Jan 7, 2024
1a733cb
Merge remote-tracking branch 'origin/main' into abstract_class
jan-janssen Jan 8, 2024
195a983
Merge remote-tracking branch 'origin/main' into abstract_class
jan-janssen Jan 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/condense_vol_two' into generic_f…
…ormat

# Conflicts:
#	atomistics/calculators/ase.py
#	atomistics/calculators/qe.py
#	atomistics/shared/thermal_expansion.py
#	atomistics/workflows/evcurve/debye.py
#	atomistics/workflows/evcurve/workflow.py
#	atomistics/workflows/phonons/workflow.py
#	atomistics/workflows/quasiharmonic.py
jan-janssen committed Jan 5, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit b6296d671804e242ef362b5c78897fe6660e76ce
26 changes: 13 additions & 13 deletions atomistics/calculators/ase.py
Original file line number Diff line number Diff line change
@@ -110,10 +110,10 @@ def calc_static_with_ase(
):
ase_exe = ASEExecutor(ase_structure=structure, ase_calculator=ase_calculator)
return OutputStatic(
forces=ase_exe.get_forces,
energy=ase_exe.get_energy,
stress=ase_exe.get_stress,
volume=ase_exe.get_volume,
forces=ase_exe.forces,
energy=ase_exe.energy,
stress=ase_exe.stress,
volume=ase_exe.volume,
).get(output=output)


@@ -127,15 +127,15 @@ def _calc_md_step_with_ase(
dyn.run(thermo)
ase_exe = ASEExecutor(ase_structure=structure, ase_calculator=ase_calculator)
calc_dict = OutputMolecularDynamics(
positions=ase_exe.get_positions,
cell=ase_exe.get_cell,
forces=ase_exe.get_forces,
temperature=ase_exe.get_temperature,
energy_pot=ase_exe.get_energy,
energy_tot=ase_exe.get_total_energy,
pressure=ase_exe.get_stress,
velocities=ase_exe.get_velocities,
volume=ase_exe.get_volume,
positions=ase_exe.positions,
cell=ase_exe.cell,
forces=ase_exe.forces,
temperature=ase_exe.temperature,
energy_pot=ase_exe.energy,
energy_tot=ase_exe.energy_tot,
pressure=ase_exe.pressure,
velocities=ase_exe.velocities,
volume=ase_exe.volume,
).get(output=output)
for k, v in calc_dict.items():
cache[k].append(v)
8 changes: 4 additions & 4 deletions atomistics/calculators/qe.py
Original file line number Diff line number Diff line change
@@ -210,10 +210,10 @@ def calc_static_with_qe(
)
qe_parser = QEStaticParser(filename=output_file_name)
return OutputStatic(
forces=qe_parser.get_forces,
energy=qe_parser.get_energy,
stress=qe_parser.get_stress,
volume=qe_parser.get_volume,
forces=qe_parser.forces,
energy=qe_parser.energy,
stress=qe_parser.stress,
volume=qe_parser.volume,
).get(output=output)


4 changes: 2 additions & 2 deletions atomistics/shared/thermal_expansion.py
Original file line number Diff line number Diff line change
@@ -18,6 +18,6 @@ def get_thermal_expansion_output(temperatures_lst, volumes_lst, output):
temperatures_lst=temperatures_lst, volumes_lst=volumes_lst
)
return OutputThermalExpansion(
temperatures=thermal_properties.get_temperatures,
volumes=thermal_properties.get_volumes,
temperatures=thermal_properties.temperatures,
volumes=thermal_properties.volumes,
).get(output=output)
10 changes: 5 additions & 5 deletions atomistics/workflows/evcurve/debye.py
Original file line number Diff line number Diff line change
@@ -241,9 +241,9 @@ def get_thermal_properties(
num_steps=num_steps,
)
return OutputThermodynamic(
temperatures=debye_thermal.get_temperatures,
free_energy=debye_thermal.get_free_energy,
entropy=debye_thermal.get_entropy,
heat_capacity=debye_thermal.get_heat_capacity,
volumes=debye_thermal.get_volumes,
temperatures=debye_thermal.temperatures,
free_energy=debye_thermal.free_energy,
entropy=debye_thermal.entropy,
heat_capacity=debye_thermal.heat_capacity,
volumes=debye_thermal.volumes,
).get(output=output)
14 changes: 7 additions & 7 deletions atomistics/workflows/evcurve/workflow.py
Original file line number Diff line number Diff line change
@@ -185,13 +185,13 @@ def analyse_structures(self, output_dict, output=energy_volume_curve_output_keys
)
)
self._fit_dict = OutputEnergyVolumeCurve(
fit_dict=ev_prop.get_fit_dict,
energy=ev_prop.get_energies,
volume=ev_prop.get_volumes,
b_prime_eq=ev_prop.get_bulkmodul_pressure_derivative_eq,
bulkmodul_eq=ev_prop.get_bulkmodul_eq,
energy_eq=ev_prop.get_energy_eq,
volume_eq=ev_prop.get_volume_eq,
fit_dict=ev_prop.fit_dict,
energy=ev_prop.energy,
volume=ev_prop.volume,
b_prime_eq=ev_prop.b_prime_eq,
bulkmodul_eq=ev_prop.bulkmodul_eq,
energy_eq=ev_prop.energy_eq,
volume_eq=ev_prop.volume_eq,
).get(output=output)
return self.fit_dict

20 changes: 10 additions & 10 deletions atomistics/workflows/phonons/workflow.py
Original file line number Diff line number Diff line change
@@ -255,11 +255,11 @@ def analyse_structures(self, output_dict, output=phonon_output_keys):
npoints=101,
)
self._phonopy_dict = OutputPhonons(
mesh_dict=phono_prop.get_mesh_dict,
band_structure_dict=phono_prop.get_band_structure_dict,
total_dos_dict=phono_prop.get_total_dos_dict,
dynamical_matrix=phono_prop.get_dynamical_matrix,
force_constants=phono_prop.get_force_constants,
mesh_dict=phono_prop.mesh_dict,
band_structure_dict=phono_prop.band_structure_dict,
total_dos_dict=phono_prop.total_dos_dict,
dynamical_matrix=phono_prop.dynamical_matrix,
force_constants=phono_prop.force_constants,
).get(output=output)
return self._phonopy_dict

@@ -301,11 +301,11 @@ def get_thermal_properties(
)
phono_thermal = PhonopyThermalProperties(phonopy_instance=self.phonopy)
return OutputThermodynamic(
temperatures=phono_thermal.get_temperatures,
free_energy=phono_thermal.get_free_energy,
entropy=phono_thermal.get_entropy,
heat_capacity=phono_thermal.get_heat_capacity,
volumes=phono_thermal.get_volumes,
temperatures=phono_thermal.temperatures,
free_energy=phono_thermal.free_energy,
entropy=phono_thermal.entropy,
heat_capacity=phono_thermal.heat_capacity,
volumes=phono_thermal.volumes,
).get(output=output)

def get_dynamical_matrix(self, npoints=101):
10 changes: 5 additions & 5 deletions atomistics/workflows/quasiharmonic.py
Original file line number Diff line number Diff line change
@@ -121,11 +121,11 @@ def get_thermal_properties(
volumes_selected_lst=vol_lst,
)
return OutputThermodynamic(
temperatures=qh_thermal.get_temperatures,
free_energy=qh_thermal.get_free_energy,
entropy=qh_thermal.get_entropy,
heat_capacity=qh_thermal.get_heat_capacity,
volumes=qh_thermal.get_volumes,
temperatures=qh_thermal.temperatures,
free_energy=qh_thermal.free_energy,
entropy=qh_thermal.entropy,
heat_capacity=qh_thermal.heat_capacity,
volumes=qh_thermal.volumes,
).get(output=output)


You are viewing a condensed version of this merge commit. You can view the full changes here.