Projects

class deareis.Project(*args, **kwargs)

A class representing a collection of notes, data sets, analysis results, simulation results, and complex plots.

add_data_set(data)

Add a data set to the project.

Parameters:

data (DataSet) – The data set to add.

add_drt(data, drt)

Add the provided DRT analysis result to the provided data set’s list of DRT analysis results.

Parameters:
  • data (DataSet) – The data set that was analyzed.

  • drt (DRTResult) – The result of the analysis.

add_fit(data, fit)

Add the provided fit result to the provided data set.

Parameters:
  • data (DataSet) – The data set that a circuit was fit to.

  • fit (FitResult) – The result of the circuit fit.

add_plot(plot)

Add the provided plot to the list of plots.

Parameters:

plot (PlotSettings) – The settings for the plot.

add_simulation(simulation)

Add the provided simulation result to the list of simulation results.

Parameters:

simulation (SimulationResult) – The result of the simulation.

add_test(data, test)

Add the provided Kramers-Kronig test result to the provided data set’s list of Kramers-Kronig test results.

Parameters:
add_zhit(data, zhit)

Add the provided Z-HIT analysis result result to the provided data set’s list of Z-HIT analysis results.

Parameters:
  • data (DataSet) – The data set that was tested.

  • zhit (ZHITResult) – The result of the analysis.

delete_data_set(data)

Delete a data set (and its associated test and fit results) from the project.

Parameters:

data (DataSet) – The data set to remove.

delete_drt(data, drt)

Delete the provided DRT analysis result from the provided data set’s list of DRT analysis results.

Parameters:
  • data (DataSet) – The data set associated with the analysis result.

  • drt (DRTResult) – The analysis result to delete.

delete_fit(data, fit)

Delete the provided fit result from the provided data set’s list of fit results.

Parameters:
  • data (DataSet) – The data set associated with the fit result.

  • fit (FitResult) – The fit result to delete.

delete_plot(plot)

Delete the provided plot from the list of plots.

Parameters:

plot (PlotSettings) – The plot settings to delete.

delete_simulation(simulation)

Remove the provided simulation result from the list of simulation results.

Parameters:

simulation (SimulationResult) – The simulation result to delete.

delete_test(data, test)

Delete the provided Kramers-Kronig test result from the provided data set’s list of Kramers-Kronig test results.

Parameters:
delete_zhit(data, zhit)

Delete the provided Z-HIT analysis result from the provided data set’s list of Z-HIT analysis results.

Parameters:
  • data (DataSet) – The data set associated with the test result.

  • zhit (ZHITResult) – The analysis result to delete.

edit_data_set_label(data, label)

Edit the label of a data set in the project. Ensures that each data set has a unique label.

Parameters:
  • data (DataSet) – The data set to rename.

  • label (str) – The new label.

edit_data_set_path(data, path)

Edit the path of a data set in the project.

Parameters:
  • data (DataSet) – The data set to edit.

  • path (str) – The new path.

edit_plot_label(plot, label)

Edit the label of a plot in the project. Ensures that each plot has a unique label.

Parameters:
  • plot (PlotSettings) – The plot settings to edit.

  • label (str) – The new label.

classmethod from_dict(state)

Create an instance from a dictionary.

Parameters:

state (dict) – A dictionary-based representation of a project state.

Return type:

Project

classmethod from_file(path)

Create an instance by parsing a file containing a Project that has been serialized using JSON.

Parameters:

path (str) – The path to a file containing a serialized project state.

Return type:

Project

classmethod from_json(json)

Create an instance by parsing a JSON string.

Parameters:

json (str) – A JSON representation of a project state.

Return type:

Project

get_all_drts()

Get a mapping of data set UUIDs to the corresponding DRT analysis results of those data sets.

Return type:

Dict[str, List[DRTResult]]

get_all_fits()

Get a mapping of data set UUIDs to the corresponding list of fit results of those data sets.

Return type:

Dict[str, List[FitResult]]

get_all_tests()

Get a mapping of data set UUIDs to the corresponding Kramers-Kronig test results of those data sets.

Return type:

Dict[str, List[KramersKronigResult]]

get_all_zhits()

Get a mapping of data set UUIDs to the corresponding Z-HIT analysis results.

Return type:

Dict[str, List[ZHITResult]]

get_data_sets()

Get the project’s data sets.

Return type:

List[DataSet]

get_drts(data)

Get the DRT analysis results associated with a specific data set.

Parameters:

data (DataSet) – The data set whose analyses to get.

Return type:

List[DRTResult]

get_fits(data)

Get fit results associated with a specific data set.

Parameters:

data (DataSet) – The data set whose fits to get.

Return type:

List[FitResult]

get_label()

Get the project’s label.

Return type:

str

get_notes()

Get the project’s notes.

Return type:

str

get_path()

Get the project’s currrent path. An empty string signifies that no path has been set previously.

Return type:

str

get_plot_series(plot)

Get PlotSeries instances of each of the plotted items/series in a specific plot.

Parameters:

plot (PlotSettings) – The plot whose items/series to get.

Return type:

List[PlotSeries]

get_plots()

Get all of the plots.

Return type:

List[PlotSettings]

get_simulations()

Get all of the simulation results.

Return type:

List[SimulationResult]

get_tests(data)

Get the Kramers-Kronig test results associated with a specific data set.

Parameters:

data (DataSet) – The data set whose tests to get.

Return type:

List[KramersKronigResult]

get_zhits(data)

Get the Z-HIT analysis results associated with a specific data set.

Parameters:

data (DataSet) – The data set whose tests to get.

Return type:

List[ZHITResult]

classmethod merge(projects)

Create an instance by merging multiple Project instances. All UUIDs are replaced to avoid collisions. The labels of some objects are also replaced to avoid collisions.

Parameters:

projects (List[Project]) – A list of the Project instances to merge.

Return type:

Project

save(path=None)

Serialize the project as a file containing a JSON string.

Parameters:

path (Optional[str], optional) – The path to write the project state to. If this is None, then the most recently defined path is used.

set_label(label)

Set the project’s label.

Parameters:

label (str) – The new label.

set_notes(notes)

Set the project’s notes.

Parameters:

notes (str) – The project notes.

set_path(path)

Set the path to use when calling the save method without arguments.

Parameters:

path (str) – The path where the project’s state should be saved.

to_dict(session)

Return a dictionary containing the project state. The dictionary can be used to recreate a project or to restore a project state.

Parameters:

session (bool) – If true, then data minimization is not performed.

Return type:

dict

update(*args, **kwargs)

Used when restoring project states.