dfttk.aggregate_extraction

Extract relevant data from VASP output files.

dfttk.aggregate_extraction.extract_configuration_data(path, outcar_name='OUTCAR.3static', oszicar_name='OSZICAR.3static', contcar_name='CONTCAR.3static', collect_mag_data=False, magmom_tolerance=0.01, total_magnetic_moment_tolerance=0.01, mass_average='geometric')[source]

Extracts the volume, configuration, energy, number of atoms, and magnetization data (if specified) from calculations run by ev_curve_series and returns a pandas DataFrame.

Parameters:
  • path (str) – the path containing a config_* folder which contain vol_* folders.

  • outcar_name (str) – name of the OUTCAR file. Defaults to “OUTCAR”.

  • oszicar_name (str) – name of the OSZICAR file. Defaults to “OSZICAR”.

  • contcar_name (str) – name of the CONTCAR file. Defaults to “CONTCAR”.

  • collect_mag_data (bool) – if True, collect the magnetization data using extract_tot_mag_data. Defaults to

  • False.

  • magmom_tolerance (float) – the tolerance for the total magnetic moment to be considered zero. Defaults to 0.01 to handle floating point errors.

  • total_magnetic_moment_tolerance (float) – the tolerance for the sum of the total magnetic moments for each atom.

  • errors. (Defaults to 0.01 to handle floating point)

  • mass_average (str) – the method used to calculate the average atomic mass. Options are “geometric” and “arithmetic”.

Returns:

a pandas DataFrame containing the volume, configuration, energy, number of atoms, and magnetization data (if specified).

Return type:

DataFrame

dfttk.aggregate_extraction.extract_convergence_data(path)[source]

Extracts and calculates energy convergence data for a series of VASP convergence calculations.

Parameters:

path (str) – path to the folder containing the VASP calculation outputs for convergence calculations.

Returns:

a pandas dataframe containing the ENCUT, kpoint grid, kppa, energy, number of atoms, energy per atom, and difference in energy per atom.

Return type:

DataFrame

dfttk.aggregate_extraction.plot_format(fig, x_title, y_title)[source]

Updates an x-y plotly figure to the basic format used in DFTTK. :type fig: Figure :param fig: A figure with x-y data. :param x_title: title of the x-axis. :type x_title: str :param y_title: title of the y-axis :type y_title: str

dfttk.aggregate_extraction.plot_encut_conv(df, show_fig=True)[source]

Makes a plot for ENCUT convergence using plotly.

Parameters:
  • df (DataFrame) – a pandas dataframe containing the ENCUT, kpoint grid, kppa, energy, number of atoms, energy per atom, and difference in energy per atom (as structured by the return of extract_convergence_data()).

  • show_fig – wheather or not to call the fig.show() method. Defaults to True.

Returns:

a plotly figure of the energy per atom vs. ENCUT.

Return type:

Figure

dfttk.aggregate_extraction.calculate_encut_conv(path, plot=True)[source]

Convenience function to calculate the energy convergence with respect to ENCUT and plots the results.

Parameters:
  • path (str) – path to the folder containing the ENCUT convergence calculation results.

  • plot (bool) – If True, plots the energy per atom vs. ENCUT. Defaults to True.

Returns:

a pandas dataframe containing the ENCUT, kpoint_grid, kppa, energy, number of atoms, energy per atom, and difference in energy per atom. go.Figure: a plotly figure of the energy per atom vs. ENCUT.

Return type:

tuple[DataFrame, Figure]

dfttk.aggregate_extraction.plot_kpoint_conv(df, show_fig=True)[source]

Makes a plot for k-point convergence using plotly.

Parameters:
  • df (DataFrame) – a pandas dataframe containing the ENCUT, kpoint grid, kppa, energy, number of atoms, energy per atom, and difference in energy per atom (as structured by the return of extract_convergence_data()).

  • show_fig – wheather or not to call the fig.show() method. Defaults to True.

Returns:

a plotly figure of the energy per atom vs. k-point density (kppa).

Return type:

Figure

dfttk.aggregate_extraction.calculate_kpoint_conv(path, plot=True)[source]

Convenience fuction to calculate the energy convergence with respect to k-point density and plots the results.

Parameters:
  • path (str) – path to the folder containing the kpoint convergence calculation results

  • plot (bool) – If True, plots the energy per atom vs. k-point density (kppa). Defaults to True.

Returns:

a pandas dataframe containing the ENCUT, kpoint_grid, kppa, energy, number of atoms, energy per atom, and difference in energy per atom. go.Figure: a plotly figure of the energy per atom vs. ENCUT.

Return type:

tuple[DataFrame, Figure]