StatisticNMR package

Submodules

LOGS_solutions.GenerateStatistics.StatisticNMR.StatisticHandlerNMR module

class LOGS_solutions.GenerateStatistics.StatisticNMR.StatisticHandlerNMR.StatisticHandlerNMR(logs, begin_date, end_date, target_path, logger)[source]

Bases: CommonHandler

Abstract class for creating statistics.

create_plot_comparison_heatmap_duration(entity_dict, entity_type)[source]

Creates a heatmap with the totalized duration times of the different entities. (Intended for measurement times of instruments)

Parameters:
  • entity_dict (Dict) – dict with all entities and their duration times (e.g. {instrument1: [(date1, time), (date2,time), …], instrument2: [(date1, time), (date2, time), …]})

  • entity_type (str) – type of the entity (e.g. ‘datasets for instrument x’)

Return type:

Figure

Returns:

plot

create_plot_instrument_num(instrument_id, instrument_name, data)[source]

Creates a pie chart for the distribution of the data.

Parameters:
  • instrument_id (int) – ID of the instrument.

  • instrument_name (str) – Name of the instrument.

  • data – Data for the distribution.

  • statistic_entity – Entity for which the distribution is created.

  • cutoff – Cutoff value for the distribution.

Return type:

Figure

Returns:

Figure with the pie chart.

create_plot_year_calendarWeek_duration(dates_list, entity_type)[source]

Creates a pie chart with the duration time within a calendar week per year, based on a standardized week length (without considering daylight saving time or partial weeks).

::param dates_list: list with all dates of the entity type :type entity_type: str :param entity_type: E.g. ‘datasets for instrument x’

Return type:

Dict[str, Figure]

create_plot_year_duration(dates_list, entity_type)[source]

Creates a block diagram of the duration time for each year, based on 365.2422 days per year.

Parameters:
  • dates_list (List) – list with all dates of the entity type.

  • entity_type (str) – E.g. ‘datasets for instrument x’.

Return type:

Dict[str, Figure]

create_plot_year_month_duration(dates_list, entity_type)[source]

Creates a pie chart of the duration time for each month in a year, based on the standard number of seconds per month, without considering leap years.

Parameters:
  • dates_list (List) – list with all dates of the entity type

  • entity_type (str) – E.g. ‘datasets for instrument x’

Return type:

Dict[str, Figure]

Returns:

Plot

abstract create_statistic()[source]

Method for generating the statistics.

LOGS_solutions.GenerateStatistics.StatisticNMR.StatisticsDurationTime module

class LOGS_solutions.GenerateStatistics.StatisticNMR.StatisticsDurationTime.StatisticsDurationTime(logs, begin_date, end_date, target_path)[source]

Bases: StatisticHandlerNMR

Class to generate.

  • statistics for the duration time of each instrument. The statistics are divided into the following parts:
    • Year duration time

    • Year month duration time

    • Year calendar week duration time

    • Comparison heatmap duration time

check_duration(dataset)[source]

Check if the duration parameter of the data set is empty or None.

Write the data set to one of the following csv files: - DurationNone.csv: If the data set has no duration parameter. - NoDurationTime.csv: If the duration parameter of the data set is empty. - DurationTime.csv: If the duration parameter of the data set is not empty.

Return type:

bool

create_statistic()[source]

Generates the statistics for the utilization time (based on “duration”) of each instrument.

This statistic is divided into the following parts: - Year utilization time - Year month utilization time - Year calendar week utilization time - Comparison heatmap utilization time

get_general_info(dataset)[source]

Checks if ‘General information/Duration’ or ‘General info/Duration’ exists in the dataset.

sum_time_strings(time_string)[source]

Sum up the given time_string in seconds.

Parameters:

time_string (str) – Time string in the format “1d 2h 3min 4s”.

Returns:

Total time in seconds.

update_instrument_dict(dataset, dataset_instrument_dict)[source]

Updating the instrument dictionary for the data set. For this purpose, the current accumulated time and the acquisition date are added to the dicitonary.

Parameters:
  • dataset (Dataset) – Data set containing the instrument.

  • dataset_instrument_dict (Dict) – Dictionary of all instruments with a list of the acquisition date of their data sets.

Return type:

Dict

Returns:

Dictionary of the instruments, each key is the id of the instrument and has the instrument name as value[0]

LOGS_solutions.GenerateStatistics.StatisticNMR.StatisticsTypesOfExperiments module

class LOGS_solutions.GenerateStatistics.StatisticNMR.StatisticsTypesOfExperiments.StatisticsTypesOfExperiments(logs, begin_date=None, end_date=None, target_path=None)[source]

Bases: StatisticHandlerNMR

This class provides methods to create statistics for the different types of NMR experiments and save them as HTML or PDF files.

create_statistic()[source]

Create the statistics of the different types of NMR experiments of each instrument.

get_dataset_instruments()[source]

Get all instruments of the datasets and count the number of each type of experiment per instrument.

Return type:

Dict[int, Tuple[str, Dict[str, int]]]

Returns:

Dictionary with instrument ID as key and a tuple with instrument name and a dictionary with experiment type as key and count as value.

Module contents