diff --git a/README.md b/README.md index e69de29..1dfecaa 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,19 @@ +# Cerc co2 emission + +Uses the cerc-hub as a base for co2_emission calculation, it's intended to be used after executing the complete monthly energy +balance workflow called building by building + +This module processes the object-oriented generalization to be used the co2 emission workflow + +# installation + +> $ pip install cerc-co2_emission + +# usage + +> from costs.co2_emission import Co2Emission +> +> Co2Emission(building, emissions_factor).co2_emission +> + +The available scenarios are defined in the constant class as an enum \ No newline at end of file diff --git a/cerc_co2_emission.egg-info/PKG-INFO b/cerc_co2_emission.egg-info/PKG-INFO index cbfe54b..270f600 100644 --- a/cerc_co2_emission.egg-info/PKG-INFO +++ b/cerc_co2_emission.egg-info/PKG-INFO @@ -1,9 +1,9 @@ Metadata-Version: 2.1 -Name: cerc-costs +Name: cerc-co2-emission Version: 0.1.0.0 -Summary: CERC costs contains the basic cost calculation per CERC-Hub building +Summary: CERC co2 emission contains the basic co2 emission calculation per CERC-Hub building Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL) Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 -CERC costs contains the basic cost calculation per CERC-Hub building +CERC co2 emission contains the basic co2 emission calculation per CERC-Hub building diff --git a/cerc_co2_emission.egg-info/SOURCES.txt b/cerc_co2_emission.egg-info/SOURCES.txt index 9cc7c29..48c5e54 100644 --- a/cerc_co2_emission.egg-info/SOURCES.txt +++ b/cerc_co2_emission.egg-info/SOURCES.txt @@ -1,20 +1,12 @@ +README.md pyproject.toml requirements.txt setup.py -cerc_costs.egg-info/PKG-INFO -cerc_costs.egg-info/SOURCES.txt -cerc_costs.egg-info/dependency_links.txt -cerc_costs.egg-info/requires.txt -cerc_costs.egg-info/top_level.txt -costs/__init__.py -costs/__main__.py -costs/capital_costs.py -costs/configuration.py -costs/constants.py -costs/cost.py -costs/cost_base.py -costs/end_of_life_costs.py -costs/total_maintenance_costs.py -costs/total_operational_costs.py -costs/total_operational_incomes.py -costs/version.py \ No newline at end of file +cerc_co2_emission.egg-info/PKG-INFO +cerc_co2_emission.egg-info/SOURCES.txt +cerc_co2_emission.egg-info/dependency_links.txt +cerc_co2_emission.egg-info/requires.txt +cerc_co2_emission.egg-info/top_level.txt +co2_emission/__init__.py +co2_emission/co2_emission.py +co2_emission/version.py \ No newline at end of file diff --git a/cerc_co2_emission.egg-info/requires.txt b/cerc_co2_emission.egg-info/requires.txt index 94cd4eb..b765df7 100644 --- a/cerc_co2_emission.egg-info/requires.txt +++ b/cerc_co2_emission.egg-info/requires.txt @@ -1,4 +1,2 @@ -numpy_financial cerc_hub -pandas setuptools diff --git a/cerc_co2_emission.egg-info/top_level.txt b/cerc_co2_emission.egg-info/top_level.txt index 73bd54b..f1c6404 100644 --- a/cerc_co2_emission.egg-info/top_level.txt +++ b/cerc_co2_emission.egg-info/top_level.txt @@ -1 +1 @@ -costs +co2_emission diff --git a/co2_emission/__init__.py b/co2_emission/__init__.py index 26cf04b..3eca432 100644 --- a/co2_emission/__init__.py +++ b/co2_emission/__init__.py @@ -1,12 +1,8 @@ """ -Cost workflow initialization +Co2 emission workflow initialization SPDX - License - Identifier: LGPL - 3.0 - or -later Copyright © 2023 Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca Code contributor Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca Code contributor Oriol Gavalda Torrellas oriol.gavalda@concordia.ca """ -from .capital_costs import CapitalCosts -from .end_of_life_costs import EndOfLifeCosts -from .total_maintenance_costs import TotalMaintenanceCosts -from .total_operational_costs import TotalOperationalCosts -from .total_operational_incomes import TotalOperationalIncomes + diff --git a/co2_emission/__pycache__/__init__.cpython-39.pyc b/co2_emission/__pycache__/__init__.cpython-39.pyc new file mode 100644 index 0000000..0c46378 Binary files /dev/null and b/co2_emission/__pycache__/__init__.cpython-39.pyc differ diff --git a/co2_emission/__pycache__/co2_emission.cpython-39.pyc b/co2_emission/__pycache__/co2_emission.cpython-39.pyc new file mode 100644 index 0000000..cdb1995 Binary files /dev/null and b/co2_emission/__pycache__/co2_emission.cpython-39.pyc differ diff --git a/co2_emission/co2_emission.py b/co2_emission/co2_emission.py index 12e04f8..95fc381 100644 --- a/co2_emission/co2_emission.py +++ b/co2_emission/co2_emission.py @@ -1,5 +1,5 @@ """ -CO2 emission module +Co2 emission module SPDX - License - Identifier: LGPL - 3.0 - or -later Copyright © 2023 Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca """ @@ -10,7 +10,7 @@ import hub.helpers.constants as cte class Co2Emission: """ - Cost class + Co2Emission class """ def __init__(self, building: Building, emissions_factor=None): diff --git a/co2_emission/version.py b/co2_emission/version.py new file mode 100644 index 0000000..5eb5981 --- /dev/null +++ b/co2_emission/version.py @@ -0,0 +1,8 @@ +""" +Co2 emission version number +SPDX - License - Identifier: LGPL - 3.0 - or -later +Copyright © 2023 Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca +Code contributor Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca +Code contributor Oriol Gavalda Torrellas oriol.gavalda@concordia.ca +""" +__version__ = '0.1.0.0' diff --git a/dist/cerc-co2-emission-0.1.0.0.tar.gz b/dist/cerc-co2-emission-0.1.0.0.tar.gz new file mode 100644 index 0000000..cdad2ff Binary files /dev/null and b/dist/cerc-co2-emission-0.1.0.0.tar.gz differ diff --git a/dist/cerc_co2_emission-0.1.0.0-py3-none-any.whl b/dist/cerc_co2_emission-0.1.0.0-py3-none-any.whl new file mode 100644 index 0000000..6dd7b65 Binary files /dev/null and b/dist/cerc_co2_emission-0.1.0.0-py3-none-any.whl differ diff --git a/pyproject.toml b/pyproject.toml index 9b933e7..dccf9c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,4 +5,4 @@ requires = ["setuptools>=61.0.0", "wheel"] build-backend = "setuptools.build_meta" [options.packages.find_namespace] -where = "costs" \ No newline at end of file +where = "co2_emission" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index add886c..b74d309 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1 @@ -numpy_financial -cerc_hub -pandas \ No newline at end of file +cerc_hub \ No newline at end of file diff --git a/setup.py b/setup.py index 93e5514..6e951e1 100644 --- a/setup.py +++ b/setup.py @@ -12,25 +12,25 @@ with pathlib.Path('requirements.txt').open() as r: install_requires.append('setuptools') main_ns = {} -version = convert_path('costs/version.py') +version = convert_path('co2_emission/version.py') with open(version) as f: exec(f.read(), main_ns) setup( - name='cerc-costs', + name='cerc-co2-emission', version=main_ns['__version__'], - description="CERC costs contains the basic cost calculation per CERC-Hub building", - long_description="CERC costs contains the basic cost calculation per CERC-Hub building", + description="CERC co2 emission contains the basic co2 emission calculation per CERC-Hub building", + long_description="CERC co2 emission contains the basic co2 emission calculation per CERC-Hub building", classifiers=[ "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Programming Language :: Python", "Programming Language :: Python :: 3", ], include_package_data=True, - packages=['costs'], + packages=['co2_emission'], setup_requires=install_requires, install_requires=install_requires, data_files=[ - ('costs', glob.glob('requirements.txt')) + ('co2_emission', glob.glob('requirements.txt')) ] ) diff --git a/tests/__pycache__/unit_tests.cpython-39.pyc b/tests/__pycache__/unit_tests.cpython-39.pyc new file mode 100644 index 0000000..c2aa4fd Binary files /dev/null and b/tests/__pycache__/unit_tests.cpython-39.pyc differ diff --git a/tests/unit_tests.py b/tests/unit_tests.py index 2ee80a5..e4fbcb7 100644 --- a/tests/unit_tests.py +++ b/tests/unit_tests.py @@ -15,9 +15,7 @@ from hub.imports.results_factory import ResultFactory from hub.imports.usage_factory import UsageFactory from hub.helpers.dictionaries import Dictionaries -from costs.cost import Cost -from costs.constants import SKIN_RETROFIT, SKIN_RETROFIT_AND_SYSTEM_RETROFIT_AND_PV, SYSTEM_RETROFIT_AND_PV -from costs.co2_emission import Co2Emission +from co2_emission.co2_emission import Co2Emission class Initialize: @@ -60,28 +58,6 @@ class Initialize: class UnitTests(unittest.TestCase): init = Initialize() - def test_current_status(self): - for building in self.init.city.buildings: - result = Cost(building).life_cycle - self.assertIsNotNone(result) - self.assertEqual(0, result.values[0]) - - def test_scenario_1(self): - for building in self.init.city.buildings: - result = Cost(building, retrofit_scenario=SKIN_RETROFIT).life_cycle - self.assertIsNotNone(result) - - def test_scenario_2(self): - for building in self.init.city.buildings: - result = Cost(building, retrofit_scenario=SYSTEM_RETROFIT_AND_PV).life_cycle - self.assertIsNotNone(result) - self.assertEqual(0, result.values[0]) - - def test_scenario_3(self): - for building in self.init.city.buildings: - result = Cost(building, retrofit_scenario=SKIN_RETROFIT_AND_SYSTEM_RETROFIT_AND_PV).life_cycle - self.assertIsNotNone(result) - def test_co2_emission(self): for building in self.init.city.buildings: result = Co2Emission(building).operational_co2