diff --git a/src/nhssynth/cli/common_arguments.py b/src/nhssynth/cli/common_arguments.py index 696b80f1..8319c33d 100644 --- a/src/nhssynth/cli/common_arguments.py +++ b/src/nhssynth/cli/common_arguments.py @@ -3,6 +3,7 @@ - All module argument lists, e.g. --dataset, --seed, etc. - A subset of module(s) argument lists, e.g. --synthetic, --typed, etc. """ + import argparse from typing import Final @@ -67,7 +68,9 @@ def get_seed_parser(overrides=False) -> argparse.ArgumentParser: return parser -COMMON_TITLE: Final = "starting any of the following args with `_` defaults to a suffix on DATASET (e.g. `_metadata` -> `_metadata`);\nall filenames are relative to `experiments//` unless otherwise stated" +COMMON_TITLE: Final = ( + "starting any of the following args with `_` defaults to a suffix on DATASET (e.g. `_metadata` -> `_metadata`);\nall filenames are relative to `experiments//` unless otherwise stated" +) def suffix_parser_generator(name: str, help: str, required: bool = False) -> argparse.ArgumentParser: diff --git a/src/nhssynth/cli/config.py b/src/nhssynth/cli/config.py index 7b95a176..fbc063e6 100644 --- a/src/nhssynth/cli/config.py +++ b/src/nhssynth/cli/config.py @@ -1,4 +1,5 @@ """Read, write and process config files, including handling of module-specific / common config overrides.""" + import argparse import warnings from importlib.metadata import version as ver diff --git a/src/nhssynth/cli/model_arguments.py b/src/nhssynth/cli/model_arguments.py index add457e3..fd864b76 100644 --- a/src/nhssynth/cli/model_arguments.py +++ b/src/nhssynth/cli/model_arguments.py @@ -1,4 +1,5 @@ """Define arguments for each of the model classes.""" + import argparse from nhssynth.common.constants import ACTIVATION_FUNCTIONS diff --git a/src/nhssynth/cli/module_arguments.py b/src/nhssynth/cli/module_arguments.py index 3398548c..d57e9ecb 100644 --- a/src/nhssynth/cli/module_arguments.py +++ b/src/nhssynth/cli/module_arguments.py @@ -1,4 +1,5 @@ """Define arguments for each of the modules' CLI sub-parsers.""" + import argparse from nhssynth.cli.model_arguments import add_model_specific_args diff --git a/src/nhssynth/cli/module_setup.py b/src/nhssynth/cli/module_setup.py index 500cbb2a..1e139a81 100644 --- a/src/nhssynth/cli/module_setup.py +++ b/src/nhssynth/cli/module_setup.py @@ -1,4 +1,5 @@ """Specify all CLI-accessible modules and their configurations, the pipeline to run by default, and define special functions for the `config` and `pipeline` CLI option trees.""" + import argparse from typing import Callable, Final, Optional diff --git a/src/nhssynth/common/common.py b/src/nhssynth/common/common.py index 5127388d..c4c4f9ce 100644 --- a/src/nhssynth/common/common.py +++ b/src/nhssynth/common/common.py @@ -1,4 +1,5 @@ """Common functions for all modules.""" + import random from typing import Optional diff --git a/src/nhssynth/common/constants.py b/src/nhssynth/common/constants.py index cce5b57a..7c33d07a 100644 --- a/src/nhssynth/common/constants.py +++ b/src/nhssynth/common/constants.py @@ -1,4 +1,5 @@ """Define all of the common constants used throughout the project.""" + from time import strftime from typing import Final diff --git a/src/nhssynth/common/debugging.py b/src/nhssynth/common/debugging.py index bdf77825..a59e6740 100644 --- a/src/nhssynth/common/debugging.py +++ b/src/nhssynth/common/debugging.py @@ -1,4 +1,5 @@ """Debugging utilities.""" + import sys import traceback import warnings diff --git a/src/nhssynth/common/dicts.py b/src/nhssynth/common/dicts.py index 3bdae0a8..e8668941 100644 --- a/src/nhssynth/common/dicts.py +++ b/src/nhssynth/common/dicts.py @@ -1,4 +1,5 @@ """Common functions for working with dictionaries.""" + from typing import Any, Union diff --git a/src/nhssynth/common/io.py b/src/nhssynth/common/io.py index 25d441e7..20e4a56c 100644 --- a/src/nhssynth/common/io.py +++ b/src/nhssynth/common/io.py @@ -1,4 +1,5 @@ """Common building-block functions for handling module input and output.""" + import warnings from pathlib import Path from typing import Union diff --git a/src/nhssynth/common/strings.py b/src/nhssynth/common/strings.py index fcded9e9..4f6f1b51 100644 --- a/src/nhssynth/common/strings.py +++ b/src/nhssynth/common/strings.py @@ -1,4 +1,5 @@ """String manipulation functions.""" + import datetime import re diff --git a/src/nhssynth/modules/dataloader/metadata.py b/src/nhssynth/modules/dataloader/metadata.py index 4048562c..12bc2bc4 100644 --- a/src/nhssynth/modules/dataloader/metadata.py +++ b/src/nhssynth/modules/dataloader/metadata.py @@ -250,9 +250,11 @@ def _assemble(self, collapse_yaml: bool) -> dict[str, dict[str, Any]]: assembled_metadata = { "columns": { cn: { - "dtype": cmd.dtype.name - if not hasattr(cmd, "datetime_config") - else {"name": cmd.dtype.name, **cmd.datetime_config}, + "dtype": ( + cmd.dtype.name + if not hasattr(cmd, "datetime_config") + else {"name": cmd.dtype.name, **cmd.datetime_config} + ), "categorical": cmd.categorical, } for cn, cmd in self._metadata.items() @@ -316,13 +318,11 @@ def get_sdv_metadata(self) -> dict[str, dict[str, dict[str, str]]]: sdv_metadata = { "columns": { cn: { - "sdtype": "boolean" - if cmd.boolean - else "categorical" - if cmd.categorical - else "datetime" - if cmd.dtype.kind == "M" - else "numerical", + "sdtype": ( + "boolean" + if cmd.boolean + else "categorical" if cmd.categorical else "datetime" if cmd.dtype.kind == "M" else "numerical" + ), } for cn, cmd in self._metadata.items() }