Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 26, 2023
1 parent 91eab68 commit ecd6ee6
Show file tree
Hide file tree
Showing 17 changed files with 50 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ class Args:

class GreenKuboDistinctDiffusionCoefficients(TrajectoryCalculator, ABC):
"""
Class for the Green-Kubo diffusion coefficient implementation
Class for the Green-Kubo diffusion coefficient implementation.
Attributes
----------
experiment : object
Expand Down Expand Up @@ -211,7 +212,8 @@ def _map_over_particles(self, ds_a: np.ndarray, ds_b: np.ndarray) -> np.ndarray:

def ref_conf_map(ref_dataset, full_ds):
"""
Maps over the atoms axis in dataset
Maps over the atoms axis in dataset.
Parameters
----------
dataset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ class Args:

class GreenKuboDiffusionCoefficients(TrajectoryCalculator, ABC):
"""
Class for the Green-Kubo diffusion coefficient implementation
Class for the Green-Kubo diffusion coefficient implementation.
Attributes
----------
experiment : object
Expand Down
6 changes: 5 additions & 1 deletion mdsuite/calculators/radial_distribution_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ def _spherical_symmetry(data: np.array) -> np.array: # TODO make it a property
----------
data : np.array
tensor_values on which to operate
Returns
-------
function_values : np.array
Expand All @@ -751,6 +752,7 @@ def _correction_1(data: np.array) -> np.array:
tensor_values : np.array
tensor_values on which to operate
Returns
-------
function_values : np.array
Expand All @@ -765,6 +767,7 @@ def _correction_2(data: np.array) -> np.array:
tensor_values : np.array
tensor_values on which to operate
Returns
-------
function_values : np.array
Expand All @@ -785,7 +788,8 @@ def _correction_2(data: np.array) -> np.array:

def _piecewise(data: np.array) -> np.array:
"""
Return a piecewise operation on a set of tensor_values
Return a piecewise operation on a set of tensor_values.
Parameters
----------
data : np.array
Expand Down
1 change: 1 addition & 0 deletions mdsuite/calculators/spatial_distribution_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def _load_positions(self, indices: list, species: str) -> tf.Tensor:
List of indices to take from the database_path
species: str
The species to load the positions from
Returns
-------
loaded_data : tf.Tensor
Expand Down
6 changes: 5 additions & 1 deletion mdsuite/database/data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def generator(
Path to the tensor_values in the database_path
dictionary : bool
If true, tensor_values is returned in a dictionary
Returns
-------
"""
Expand Down Expand Up @@ -242,6 +243,7 @@ def atom_generator(
Path to the tensor_values in the database_path
dictionary : bool
If true, tensor_values is returned in a dictionary
Returns
-------
"""
Expand Down Expand Up @@ -308,7 +310,8 @@ def ensemble_generator(self, system: bool = False, glob_data: dict = None) -> tu

def dictionary_generator(ensemble_loop, correlation_time, data_range):
"""
Generator for the ensemble loop
Generator for the ensemble loop.
Parameters
----------
ensemble_loop : int
Expand All @@ -317,6 +320,7 @@ def dictionary_generator(ensemble_loop, correlation_time, data_range):
Distance between ensembles
data_range : int
Size of each ensemble
Returns
-------
None.
Expand Down
3 changes: 2 additions & 1 deletion mdsuite/database/simulation_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ def __init__(self, species_list: List[SpeciesInfo], chunk_size: int):

def add_data(self, data: np.ndarray, config_idx, species_name, property_name):
"""
Add configuration data to the chunk
Add configuration data to the chunk.
Parameters
----------
data:
Expand Down
6 changes: 4 additions & 2 deletions mdsuite/experiment/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,8 @@ def add_data(
appropriate file reader with its default arguments. If you have a custom data
format with its own reader or want to use non-default arguments for your reader,
instantiate the reader and pass it to this method.
TODO reference online documentation of data loading in the error messages
TODO reference online documentation of data loading in the error messages.
Parameters
----------
simulation_data : str or pathlib.Path or mdsuite.file_io.file_read.FileProcessor
Expand Down Expand Up @@ -688,7 +689,8 @@ def update_species_attributes_with_pubchempy(species_list: List[SpeciesInfo]):
def _species_list_to_architecture_dict(species_list, n_configurations):
# TODO let the database handler use the species list directly instead of the dict
"""
converter from species list to legacy architecture dict
converter from species list to legacy architecture dict.
Parameters
----------
species_list
Expand Down
3 changes: 2 additions & 1 deletion mdsuite/experiment/run_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ class RunModule:
"""

def __init__(self, parent, module_dict, **kwargs):
"""Initialize the attributes
"""Initialize the attributes.
Parameters
----------
parent: Experiment
Expand Down
1 change: 1 addition & 0 deletions mdsuite/file_io/extxyz_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ def _get_property_to_column_idx_dict(
header to analyse
var_names:
dict of translations from MDsuite property names to extxyz property names
Returns
-------
species_index: int
Expand Down
3 changes: 2 additions & 1 deletion mdsuite/file_io/lammps_flux_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ def __init__(
"""
Initialize the lammps flux reader. Since the flux file does not have a fixed
expected content, you need to provide the necessary metadata
(sample_rate, box_l) here manually
(sample_rate, box_l) here manually.
Parameters
----------
file_path
Expand Down
3 changes: 2 additions & 1 deletion mdsuite/file_io/script_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def __init__(
self, data: TrajectoryChunkData, metadata: TrajectoryMetadata, name: str
):
"""
Provide all the data needed for this class to act as a FileProcessor
Provide all the data needed for this class to act as a FileProcessor.
Parameters
----------
data
Expand Down
12 changes: 8 additions & 4 deletions mdsuite/file_io/tabular_text_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def __init__(
Init, also handles the combination of file_format_column_names and
custom_column_names.
The result, self._column_name_dict is supposed to be used by child functions to
create their TabularTextFileReaderData
create their TabularTextFileReaderData.
Parameters
----------
file_path:
Expand Down Expand Up @@ -164,7 +165,8 @@ def _read_process_n_configurations(
n_header_lines: int = 0,
) -> mdsuite.database.simulation_database.TrajectoryChunkData:
"""
Read n configurations and package them into a trajectory chunk of the right format
Read n configurations and package them into a trajectory chunk of the right format.
Parameters
----------
file:
Expand Down Expand Up @@ -223,7 +225,8 @@ def _read_process_n_configurations(
def read_n_lines(file, n_lines: int, start_at: int = None) -> list:
"""
Get n_lines lines, starting at line number start_at.
If start_at is None, read from the current file state
If start_at is None, read from the current file state.
Returns
-------
A list of strings, one string for each line.
Expand All @@ -236,7 +239,8 @@ def read_n_lines(file, n_lines: int, start_at: int = None) -> list:

def skip_n_lines(file, n_lines: int) -> None:
"""
skip n_lines in file
skip n_lines in file.
Parameters
----------
file: the file where we skip lines
Expand Down
1 change: 1 addition & 0 deletions mdsuite/memory_management/memory_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ def get_ensemble_loop(
Data range to be used in the analysis.
correlation_time : int
Correlation time to be considered when looping over the tensor_values
Returns
-------
data_range_partitions : int
Expand Down
2 changes: 2 additions & 0 deletions mdsuite/project/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ def disable_experiments(self, names: Union[str, list]):
----------
names: Name or list of names of experiments that should be instantiated
and loaded into self.experiments
Returns
-------
Expand All @@ -297,6 +298,7 @@ def add_data(self, data_sets: dict):
values: str or mdsuite.file_io.file_read.FileProcessor
refer to mdsuite.experiment.add_data() for an explanation of the file
specification options
Returns
-------
Updates the experiment classes.
Expand Down
9 changes: 6 additions & 3 deletions mdsuite/transformations/transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ def _save_output(
Save the tensor_values into the database_path
# todo for the future: this should not be part of the transformation.
# the transformation should yield a batch and the experiment should take care of
# storing it in the correct place, just as with file inputs
# storing it in the correct place, just as with file inputs.
Returns
-------
saves the tensor_values to the database_path.
Expand Down Expand Up @@ -446,7 +447,8 @@ class SingleSpeciesTrafo(Transformations):
def run_transformation(self, species: typing.Iterable[str] = None):
"""
Perform the batching and data loading for the transformation,
then calls transform_batch
then calls transform_batch.
Parameters
----------
species : Iterable[str]
Expand Down Expand Up @@ -553,7 +555,8 @@ class MultiSpeciesTrafo(Transformations):
def run_transformation(self, species: typing.Iterable[str] = None) -> None:
"""
Perform the batching and data loading for the transformation,
then calls transform_batch
then calls transform_batch.
Parameters
----------
species : Iterable[str]
Expand Down
3 changes: 2 additions & 1 deletion mdsuite/utils/meta_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,8 @@ def get_nearest_divisor(a: int, b: int) -> int:

def split_array(data: np.array, condition: np.array) -> list:
"""
split an array by a condition
split an array by a condition.
Parameters
----------
data : np.array
Expand Down
1 change: 1 addition & 0 deletions mdsuite/utils/scale_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def quadratic_scale_function(
Scalar scaling factor for the inner multiplication
outer_scale_factor : int
Scalar scaling factor for the outer multiplication
Returns
-------
scaled_memory : int
Expand Down

0 comments on commit ecd6ee6

Please sign in to comment.