From 74973391df8d07c50f83c7e3bf422b19ea90b88c Mon Sep 17 00:00:00 2001 From: Tom Barbette Date: Fri, 15 Nov 2024 20:24:17 +0100 Subject: [PATCH] Move types to models It creates a problem with Python 3.8 on docker as "types" package name clashes with python "types" --- integration/test_unittest.py | 2 +- npf/build.py | 2 +- npf/expdesign/zltexp.py | 2 +- npf/graph.py | 2 +- npf/grapher.py | 10 +++++----- npf/{types => models}/__init__.py | 0 npf/{types => models}/dataset.py | 2 +- npf/{types => models}/notebook/__init__.py | 0 npf/{types => models}/notebook/notebook.py | 0 npf/{types => models}/notebook/template.ipynb | 0 npf/{types => models}/series.py | 0 npf/{types => models}/web/__init__.py | 0 npf/{types => models}/web/web.py | 0 npf/pipeline/pypost.py | 2 +- npf/regression.py | 2 +- npf/statistics.py | 2 +- npf/test.py | 2 +- npf/test_driver.py | 4 ++-- npf_compare.py | 2 +- 19 files changed, 17 insertions(+), 17 deletions(-) rename npf/{types => models}/__init__.py (100%) mode change 100755 => 100644 rename npf/{types => models}/dataset.py (99%) rename npf/{types => models}/notebook/__init__.py (100%) rename npf/{types => models}/notebook/notebook.py (100%) rename npf/{types => models}/notebook/template.ipynb (100%) rename npf/{types => models}/series.py (100%) rename npf/{types => models}/web/__init__.py (100%) mode change 100755 => 100644 rename npf/{types => models}/web/web.py (100%) diff --git a/integration/test_unittest.py b/integration/test_unittest.py index 6d3fa920..69477463 100644 --- a/integration/test_unittest.py +++ b/integration/test_unittest.py @@ -12,7 +12,7 @@ from npf.test import Test from npf.build import Build from npf.variable import RangeVariable, SimpleVariable, dtype, numeric_dict -from npf.types.dataset import Run +from npf.models.dataset import Run import numpy as np import logging diff --git a/npf/build.py b/npf/build.py index f18b7bff..85b43475 100755 --- a/npf/build.py +++ b/npf/build.py @@ -5,7 +5,7 @@ from pathlib import Path import re from npf import variable, npf -from npf.types.dataset import Run, Dataset +from npf.models.dataset import Run, Dataset import copy renametable = { diff --git a/npf/expdesign/zltexp.py b/npf/expdesign/zltexp.py index 55a9f57b..78bfb71e 100644 --- a/npf/expdesign/zltexp.py +++ b/npf/expdesign/zltexp.py @@ -4,7 +4,7 @@ import numpy as np from npf.expdesign.fullexp import FullVariableExpander -from npf.types.dataset import Run +from npf.models.dataset import Run from npf.variable import Variable class OptVariableExpander(FullVariableExpander): diff --git a/npf/graph.py b/npf/graph.py index 85edbc8d..81372819 100644 --- a/npf/graph.py +++ b/npf/graph.py @@ -1,4 +1,4 @@ -from npf.types.dataset import convert_to_xyeb +from npf.models.dataset import convert_to_xyeb from npf.variable import is_numeric, get_numeric import numpy as np diff --git a/npf/grapher.py b/npf/grapher.py index ec334454..5d10ce80 100644 --- a/npf/grapher.py +++ b/npf/grapher.py @@ -6,9 +6,9 @@ import traceback import sys -from npf.types.notebook.notebook import prepare_notebook_export +from npf.models.notebook.notebook import prepare_notebook_export -from npf.types.web.web import prepare_web_export +from npf.models.web.web import prepare_web_export if sys.version_info < (3, 7): from orderedset import OrderedSet else: @@ -23,9 +23,9 @@ from pygtrie import Trie from math import log,pow -from npf.types import dataset -from npf.types.series import Series -from npf.types.dataset import Run, XYEB, AllXYEB, group_val, var_divider, mask_from_filter +from npf.models import dataset +from npf.models.series import Series +from npf.models.dataset import Run, XYEB, AllXYEB, group_val, var_divider, mask_from_filter from npf.variable import is_log, is_numeric, get_numeric, numericable, get_bool, is_bool from npf.section import SectionVariable from npf.build import Build diff --git a/npf/types/__init__.py b/npf/models/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from npf/types/__init__.py rename to npf/models/__init__.py diff --git a/npf/types/dataset.py b/npf/models/dataset.py similarity index 99% rename from npf/types/dataset.py rename to npf/models/dataset.py index 11a0022c..88d1a652 100644 --- a/npf/types/dataset.py +++ b/npf/models/dataset.py @@ -14,7 +14,7 @@ from npf import npf from npf.variable import is_numeric, get_numeric, numeric_dict -from npf.types.web.web import prepare_web_export +from npf.models.web.web import prepare_web_export class Run: def __init__(self, variables): diff --git a/npf/types/notebook/__init__.py b/npf/models/notebook/__init__.py similarity index 100% rename from npf/types/notebook/__init__.py rename to npf/models/notebook/__init__.py diff --git a/npf/types/notebook/notebook.py b/npf/models/notebook/notebook.py similarity index 100% rename from npf/types/notebook/notebook.py rename to npf/models/notebook/notebook.py diff --git a/npf/types/notebook/template.ipynb b/npf/models/notebook/template.ipynb similarity index 100% rename from npf/types/notebook/template.ipynb rename to npf/models/notebook/template.ipynb diff --git a/npf/types/series.py b/npf/models/series.py similarity index 100% rename from npf/types/series.py rename to npf/models/series.py diff --git a/npf/types/web/__init__.py b/npf/models/web/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from npf/types/web/__init__.py rename to npf/models/web/__init__.py diff --git a/npf/types/web/web.py b/npf/models/web/web.py similarity index 100% rename from npf/types/web/web.py rename to npf/models/web/web.py diff --git a/npf/pipeline/pypost.py b/npf/pipeline/pypost.py index 092f27c4..d913a133 100644 --- a/npf/pipeline/pypost.py +++ b/npf/pipeline/pypost.py @@ -3,7 +3,7 @@ from typing import List -from npf.types.series import Series +from npf.models.series import Series def execute_pypost(series: List[Series]): diff --git a/npf/regression.py b/npf/regression.py index dbc938b6..bfd5a263 100644 --- a/npf/regression.py +++ b/npf/regression.py @@ -3,7 +3,7 @@ from npf.grapher import * from npf.repository import * from npf.test import Test, SectionScript, ScriptInitException -from npf.types.dataset import Dataset +from npf.models.dataset import Dataset """Handles regression tests. That is, given an history of versions, execute tests for all previous versions diff --git a/npf/statistics.py b/npf/statistics.py index 8c2b4ec5..902eb8b7 100644 --- a/npf/statistics.py +++ b/npf/statistics.py @@ -15,7 +15,7 @@ from npf.build import Build from npf.test import Test -from npf.types.dataset import Dataset +from npf.models.dataset import Dataset from npf import npf class Statistics: diff --git a/npf/test.py b/npf/test.py index c7766585..98d96ef0 100755 --- a/npf/test.py +++ b/npf/test.py @@ -18,7 +18,7 @@ from npf.section import * from npf.npf import get_valid_filename from npf.sections import Section, SectionNull -from npf.types.dataset import Run, Dataset +from npf.models.dataset import Run, Dataset from npf.eventbus import EventBus from .variable import get_bool from decimal import * diff --git a/npf/test_driver.py b/npf/test_driver.py index 99565039..1df256da 100644 --- a/npf/test_driver.py +++ b/npf/test_driver.py @@ -6,8 +6,8 @@ from npf.repository import Repository from npf.statistics import Statistics from npf.test import Test -from npf.types.dataset import Dataset, Run -from npf.types.series import Series +from npf.models.dataset import Dataset, Run +from npf.models.series import Series """Runs all tests for a given list of tests (or a folder to expand), and a series of repositories. diff --git a/npf_compare.py b/npf_compare.py index bfefe323..fb278144 100755 --- a/npf_compare.py +++ b/npf_compare.py @@ -20,7 +20,7 @@ from npf import npf -from npf.types.series import Series +from npf.models.series import Series from npf.test_driver import group_series