Utilities#

directupsampling.utils.ase2mlip_stress(ase_stress: ndarray, cell_volume: float)[source]#
directupsampling.utils.chunks(iterable: Iterable, n: int, fill_none: bool = False) list[source]#

Yield n chunks from an iterable.

directupsampling.utils.gather_chunks(chunked: list[list] | None)[source]#
directupsampling.utils.get_calcs_names(*calcs: Calculator)[source]#
directupsampling.utils.make_single_point_calculator(atoms: Atoms)[source]#
directupsampling.utils.mlip2ase_stress(mlip_stress: ndarray, cell_volume: float)[source]#
directupsampling.utils.set_volume(atoms: Atoms, volume: float) Atoms[source]#

Set the volume of an Atoms object, keeping the shape of the cell.

Parameters#

atomsAtoms

ASE Atoms object.

volumefloat

Volume of the simulation cell.

Returns#

Atoms

class directupsampling.plot_tools.EOSPlot(eos: EOS)[source]#

Bases: object

plot()[source]#
plot_pressure(show=False)[source]#
class directupsampling.plot_tools.ExactPhononsPlot(phonons: BasePhonons)[source]#

Bases: PhononsPlot

plot_frequencies()[source]#
plot_phonon_dispersion()[source]#
class directupsampling.plot_tools.FEContribPlot(free_energy_contrib: FreeEnergyContrib, max_lines: int = 20)[source]#

Bases: object

plot()[source]#
plot_raw_data_vs_temperature()[source]#
plot_raw_data_vs_volume()[source]#
plot_vs_temperature()[source]#

Plot as function of temperature for fixed volumes.

plot_vs_volume()[source]#

Plot as function of volume for fixed temperatures.

reduce_fix_values(values: list)[source]#
set_common()[source]#
class directupsampling.plot_tools.FreeEnergySurfacePlot(free_energy_surface: FreeEnergySurface)[source]#

Bases: object

plot_vs_volume(temperature, names=None)[source]#
class directupsampling.plot_tools.MeshPhononsPlot(phonons: BasePhonons)[source]#

Bases: PhononsPlot

plot_frequencies()[source]#
plot_phonon_dispersion()[source]#
class directupsampling.plot_tools.PhononsPlot(phonons: BasePhonons)[source]#

Bases: object

abstractmethod plot_frequencies()[source]#
abstractmethod plot_phonon_dispersion()[source]#
class directupsampling.plot_tools.ThermoIntFitPlot(tifit: ThermoIntFit)[source]#

Bases: object

plot(**kwargs)[source]#
plot_all()[source]#
plot_raw_data(**kwargs)[source]#
class directupsampling.plot_tools.ThermoIntPlot(ti: ThermoInt)[source]#

Bases: object

plot(**kwargs: dict) None[source]#
class directupsampling.plot_tools.ThermoPlot(thermo: Thermo)[source]#

Bases: object

plot(properties: list[str] | None = None) None[source]#
directupsampling.plot_tools.plot(obj, **kwargs)[source]#

Plot a directupsampling object.

Returns#

matplotlib.pyplot

class directupsampling.parallel.BaseMPI[source]#

Bases: ABC

abstractmethod allgather(value)[source]#
abstractmethod broadcast(value, root=0)[source]#
abstractmethod gather(value, root=0)[source]#
abstractmethod scatter(list_, root=0)[source]#
class directupsampling.parallel.DummyMPI[source]#

Bases: BaseMPI, DummyMPI

allgather(value)[source]#
broadcast(value, root=0)[source]#
gather(value, root=0)[source]#
rank = 0#
scatter(list_, root=0)[source]#
size = 1#
class directupsampling.parallel.MPI[source]#

Bases: object

Wrapper for MPI world object.

Decides at runtime (after all imports) which one to use:

  • MPI4Py

  • a dummy implementation for serial runs

class directupsampling.parallel.MPI4Py(mpi4py_comm=None)[source]#

Bases: BaseMPI, MPI4PY

allgather(value)[source]#
broadcast(value, root=0)[source]#
gather(value, root=0)[source]#
scatter(list_, root=0)[source]#
directupsampling.parallel.broadcast(*args, **kwargs)[source]#
directupsampling.parallel.parcall(function, *args, comm=None, **kwargs)[source]#

Call only on comm master rank.

kwarg :comm: is reserved and not passed to :function:, otherwise args and kwargs are passed.

directupsampling.parallel.parlog(message, logger, level='info', comm=None)[source]#

For logger call only on master rank.

directupsampling.parallel.paropen(*args, **kwargs)[source]#
directupsampling.parallel.parprint(*args, **kwargs)[source]#