Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BREAKING] Change module imports to private scope #515

Merged
merged 15 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
author = "Steven Atkinson"

# TODO update this automatically from nam.__version__!
release = "0.11"
version = "0.11.1"
release = "0.12"
version = "0.12.0"

# -- General configuration

Expand Down
4 changes: 2 additions & 2 deletions nam/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Created Date: Saturday February 5th 2022
# Author: Steven Atkinson (steven@atkinson.mn)

from copy import deepcopy
from copy import deepcopy as _deepcopy


class InitializableFromConfig(object):
Expand All @@ -12,4 +12,4 @@ def init_from_config(cls, config):

@classmethod
def parse_config(cls, config):
return deepcopy(config)
return _deepcopy(config)
22 changes: 11 additions & 11 deletions nam/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,17 @@ def removesuffix(s: str, suffix: str) -> str:

_apply_extensions()

import json
from argparse import ArgumentParser
from pathlib import Path
import json as _json
from argparse import ArgumentParser as _ArgumentParser
from pathlib import Path as _Path

from nam.train.full import main as _nam_full
from nam.train.gui import run as nam_gui # noqa F401 Used as an entry point
from nam.util import timestamp
from nam.train.gui import run as _nam_gui # noqa F401 Used as an entry point
from nam.util import timestamp as _timestamp


def nam_full():
parser = ArgumentParser()
parser = _ArgumentParser()
parser.add_argument("data_config_path", type=str)
parser.add_argument("model_config_path", type=str)
parser.add_argument("learning_config_path", type=str)
Expand All @@ -96,17 +96,17 @@ def nam_full():

args = parser.parse_args()

def ensure_outdir(outdir: str) -> Path:
outdir = Path(outdir, timestamp())
def ensure_outdir(outdir: str) -> _Path:
outdir = _Path(outdir, _timestamp())
outdir.mkdir(parents=True, exist_ok=False)
return outdir

outdir = ensure_outdir(args.outdir)
# Read
with open(args.data_config_path, "r") as fp:
data_config = json.load(fp)
data_config = _json.load(fp)
with open(args.model_config_path, "r") as fp:
model_config = json.load(fp)
model_config = _json.load(fp)
with open(args.learning_config_path, "r") as fp:
learning_config = json.load(fp)
learning_config = _json.load(fp)
_nam_full(data_config, model_config, learning_config, outdir, args.no_show)
Loading
Loading