diff --git a/CITATION.cff b/CITATION.cff index 6ecad8d..7b5f8e2 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -16,6 +16,9 @@ authors: - family-names: "Rao" given-names: "Akshay K." orcid: "https://orcid.org/0000-0002-9054-476X" + - family-names: "Dudchenko" + given-names: "Alexander V." + orcid: "https://orcid.org/0000-0002-4808-6195" - family-names: "Mauter" given-names: "Meagan S." orcid: "https://orcid.org/0000-0002-4932-890X" diff --git a/docs/json_rep.rst b/docs/json_rep.rst index f72d233..897eeaf 100644 --- a/docs/json_rep.rst +++ b/docs/json_rep.rst @@ -305,7 +305,7 @@ Below are two tables: first is all the ``Node`` subclasses and the second the at +---------------+--------------------+----------------------+---------------------------------+----------------------------------+-----------------------+-----------------------------+---------------------------+----------------------------+----------------------------+------------------------+----------------------------+----------------------------+----------------+-------------+--------------------------+-------------------------+-------------------------------+--------------------------+------------------+-----------+--------------------------+-----------------+---------+--------------+--------------+-----------------+---------+---------+--------------+-------------+----------------+ | Reactor | |check| | |check| | |check| | |check| | | | |check| | | | |check| | | | | | | | | | | | | | | |check| | | |check| | |check| | | | | | +---------------+--------------------+----------------------+---------------------------------+----------------------------------+-----------------------+-----------------------------+---------------------------+----------------------------+----------------------------+------------------------+----------------------------+----------------------------+----------------+-------------+--------------------------+-------------------------+-------------------------------+--------------------------+------------------+-----------+--------------------------+-----------------+---------+--------------+--------------+-----------------+---------+---------+--------------+-------------+----------------+ - | StaticMixer | |check| | |check| | |check| | |check| | | | | |check| | |check| | | | | | | | | | | | | | | | |check| | | |check| | |check| | | | | | + | StaticMixing | |check| | |check| | |check| | |check| | | | | |check| | |check| | | | | | | | | | | | | | | | |check| | | |check| | |check| | | | | | +---------------+--------------------+----------------------+---------------------------------+----------------------------------+-----------------------+-----------------------------+---------------------------+----------------------------+----------------------------+------------------------+----------------------------+----------------------------+----------------+-------------+--------------------------+-------------------------+-------------------------------+--------------------------+------------------+-----------+--------------------------+-----------------+---------+--------------+--------------+-----------------+---------+---------+--------------+-------------+----------------+ | Reservoir | |check| | |check| | |check| | |check| | | | |check| | | | |check| | | | | | | | | | | | | | | | | | | | | | | +---------------+--------------------+----------------------+---------------------------------+----------------------------------+-----------------------+-----------------------------+---------------------------+----------------------------+----------------------------+------------------------+----------------------------+----------------------------+----------------+-------------+--------------------------+-------------------------+-------------------------------+--------------------------+------------------+-----------+--------------------------+-----------------+---------+--------------+--------------+-----------------+---------+---------+--------------+-------------+----------------+ diff --git a/pype_schema/connection.py b/pype_schema/connection.py index 9660a0c..2cb1d1f 100644 --- a/pype_schema/connection.py +++ b/pype_schema/connection.py @@ -1097,6 +1097,7 @@ def __init__( contents, source, destination, + frequency=None, tags={}, bidirectional=False, exit_point=None, @@ -1106,6 +1107,7 @@ def __init__( self.contents = contents self.source = source self.destination = destination + self.frequency = frequency self.tags = tags self.bidirectional = bidirectional self.exit_point = exit_point @@ -1122,10 +1124,15 @@ def __repr__(self): else: entry_point_id = self.entry_point.id + if self.frequency is None: + frequency_txt = "None" + else: + frequency_txt = str(self.frequency) + return ( f"\n" ) diff --git a/pype_schema/data/desal_sample.json b/pype_schema/data/desal_sample.json index 3b9a4dc..24fe3e7 100644 --- a/pype_schema/data/desal_sample.json +++ b/pype_schema/data/desal_sample.json @@ -175,7 +175,7 @@ "tags": {} }, "StaticMixer": { - "type": "StaticMixer", + "type": "StaticMixing", "elevation (meters)": null, "volume (cubic meters)": null, "input_contents": "ChlorinatedSeawater", diff --git a/pype_schema/data/wrrf_sample.json b/pype_schema/data/wrrf_sample.json index bb70c94..87b236f 100644 --- a/pype_schema/data/wrrf_sample.json +++ b/pype_schema/data/wrrf_sample.json @@ -254,7 +254,7 @@ } }, "OxygenPlant": { - "type": "Separator", + "type": "Separation", "input_contents": "Air", "output_contents": ["Oxygen", "IdealGas"], "num_units": 1, diff --git a/pype_schema/node.py b/pype_schema/node.py index 9bbf924..23c6e26 100644 --- a/pype_schema/node.py +++ b/pype_schema/node.py @@ -2071,14 +2071,14 @@ def del_dosing_rate(self): dosing_rate = property(get_dosing_rate, set_dosing_rate, del_dosing_rate) -class StaticMixer(Reactor): +class StaticMixing(Reactor): """A tank containing a static mixer, typically used for coagulation in water treatment. Parameters ---------- id : str - StaticMixer ID + Static mixer ID input_contents : ContentsType or list of ContentsType Contents entering the mixer @@ -2116,7 +2116,7 @@ class StaticMixer(Reactor): Attributes ---------- id : str - StaticMixer ID + Static mixer ID input_contents : list of ContentsType Contents entering the mixer @@ -2183,7 +2183,7 @@ def __init__( def __repr__(self): return ( - f">", "~", "-"] BINARY_OPS = ["+", "-", "*", "/"] diff --git a/pype_schema/tests/data/connection_less_than.json b/pype_schema/tests/data/connection_less_than.json index 2412429..549dec7 100644 --- a/pype_schema/tests/data/connection_less_than.json +++ b/pype_schema/tests/data/connection_less_than.json @@ -295,7 +295,7 @@ } }, "OxygenPlant": { - "type": "Separator", + "type": "Separation", "input_contents": "Air", "output_contents": ["Oxygen", "IdealGas"], "num_units": 1, @@ -1061,6 +1061,10 @@ "avg": null, "units": "tons / day" }, + "frequency": { + "value": "1", + "units": "day" + }, "tags": {} }, "SolidsDisposal": { diff --git a/pype_schema/tests/data/merged.json b/pype_schema/tests/data/merged.json index 3e1ab93..6c07bc5 100644 --- a/pype_schema/tests/data/merged.json +++ b/pype_schema/tests/data/merged.json @@ -1276,7 +1276,7 @@ "num_units": 8 }, "OxygenPlant": { - "type": "Separator", + "type": "Separation", "input_contents": "Air", "output_contents": [ "Oxygen", diff --git a/pype_schema/tests/data/merged_wwtp.json b/pype_schema/tests/data/merged_wwtp.json index c66a038..32244ab 100644 --- a/pype_schema/tests/data/merged_wwtp.json +++ b/pype_schema/tests/data/merged_wwtp.json @@ -772,7 +772,7 @@ "num_units": 8 }, "OxygenPlant": { - "type": "Separator", + "type": "Separation", "input_contents": "Air", "output_contents": [ "Oxygen", diff --git a/pype_schema/tests/data/sample.pkl b/pype_schema/tests/data/sample.pkl index b89c0d9..cafb664 100644 Binary files a/pype_schema/tests/data/sample.pkl and b/pype_schema/tests/data/sample.pkl differ diff --git a/pype_schema/tests/test_connection.py b/pype_schema/tests/test_connection.py index 436b961..299f729 100644 --- a/pype_schema/tests/test_connection.py +++ b/pype_schema/tests/test_connection.py @@ -370,7 +370,12 @@ def test_get_fallback_error(json_path, conn_id): ( "../data/desal_sample.json", "AntiscalantDelivery", - "\n", # noqa: E501 + "\n", # noqa: E501 + ), + ( + "data/connection_less_than.json", + "BiosolidsDelivery", + "\n", # noqa: E501 ), ], ) diff --git a/pype_schema/units.py b/pype_schema/units.py index 2bd69a8..da06845 100644 --- a/pype_schema/units.py +++ b/pype_schema/units.py @@ -133,7 +133,7 @@ # default formatting includes 4 significant digits. # This can be overridden on a per-print basis with # print('{:.3f}'.format(3 * ureg.m / 9)). -u.default_format = ".4g" +u.default_format = ".4" units_path = os.path.join(os.path.dirname(__file__), "data", "unit_definitions.txt") u.load_definitions(units_path)