Skip to content

Commit

Permalink
Formatting per black
Browse files Browse the repository at this point in the history
  • Loading branch information
HarrisonWilde committed Feb 28, 2024
1 parent 2e70026 commit a6187b8
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 11 deletions.
5 changes: 4 additions & 1 deletion src/nhssynth/cli/common_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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` -> `<DATASET>_metadata`);\nall filenames are relative to `experiments/<EXPERIMENT_NAME>/` unless otherwise stated"
COMMON_TITLE: Final = (
"starting any of the following args with `_` defaults to a suffix on DATASET (e.g. `_metadata` -> `<DATASET>_metadata`);\nall filenames are relative to `experiments/<EXPERIMENT_NAME>/` unless otherwise stated"
)


def suffix_parser_generator(name: str, help: str, required: bool = False) -> argparse.ArgumentParser:
Expand Down
1 change: 1 addition & 0 deletions src/nhssynth/cli/config.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions src/nhssynth/cli/model_arguments.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define arguments for each of the model classes."""

import argparse

from nhssynth.common.constants import ACTIVATION_FUNCTIONS
Expand Down
1 change: 1 addition & 0 deletions src/nhssynth/cli/module_arguments.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions src/nhssynth/cli/module_setup.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions src/nhssynth/common/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Common functions for all modules."""

import random
from typing import Optional

Expand Down
1 change: 1 addition & 0 deletions src/nhssynth/common/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Define all of the common constants used throughout the project."""

from time import strftime
from typing import Final

Expand Down
1 change: 1 addition & 0 deletions src/nhssynth/common/debugging.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Debugging utilities."""

import sys
import traceback
import warnings
Expand Down
1 change: 1 addition & 0 deletions src/nhssynth/common/dicts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Common functions for working with dictionaries."""

from typing import Any, Union


Expand Down
1 change: 1 addition & 0 deletions src/nhssynth/common/io.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Common building-block functions for handling module input and output."""

import warnings
from pathlib import Path
from typing import Union
Expand Down
1 change: 1 addition & 0 deletions src/nhssynth/common/strings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""String manipulation functions."""

import datetime
import re

Expand Down
20 changes: 10 additions & 10 deletions src/nhssynth/modules/dataloader/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
}
Expand Down

0 comments on commit a6187b8

Please sign in to comment.