diff --git a/.readthedocs.yml b/.readthedocs.yml index dfcea8b6..2e6437be 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,10 +1,14 @@ version: 2 +build: + os: "ubuntu-22.04" + tools: + python: "3.11" + sphinx: configuration: docs/conf.py python: - version: "3.8" install: - method: pip path: . diff --git a/buildstockbatch/__version__.py b/buildstockbatch/__version__.py index 0c4d205f..cfab5a93 100644 --- a/buildstockbatch/__version__.py +++ b/buildstockbatch/__version__.py @@ -4,7 +4,7 @@ __title__ = 'buildstockbatch' __description__ = 'Executing BuildStock projects on batch infrastructure.' __url__ = 'http://github.com/NREL/buildstockbatch' -__version__ = '2023.6.0' +__version__ = '2023.10.0' __schema_version__ = '0.3' __author__ = 'Noel Merket' __author_email__ = 'noel.merket@nrel.gov' diff --git a/buildstockbatch/base.py b/buildstockbatch/base.py index fa95b6f4..99d44a1d 100644 --- a/buildstockbatch/base.py +++ b/buildstockbatch/base.py @@ -19,6 +19,7 @@ import numpy as np import re import requests +import semver import shutil import subprocess import tempfile @@ -747,21 +748,16 @@ def validate_resstock_or_comstock_version(project_file): buildstock_rb = os.path.join(cfg['buildstock_directory'], 'resources/buildstock.rb') if os.path.exists(buildstock_rb): - versions = {} with open(buildstock_rb, 'r') as f: - for line in f: - line = line.strip() - for tool in ['ResStock_Version', 'ComStock_Version', 'BuildStockBatch_Version']: - if line.startswith(tool): - lhs, rhs = line.split('=') - version, _ = rhs.split('#') - versions[tool] = eval(version.strip()) - BuildStockBatch_Version = versions['BuildStockBatch_Version'] + versions = dict( + re.findall(r"^\s*(ResStock|ComStock|BuildStockBatch)_Version\s*=\s*'(.+)'", f.read(), re.MULTILINE) + ) + BuildStockBatch_Version = semver.Version.parse(versions['BuildStockBatch']) if bsb_version < BuildStockBatch_Version: - if 'ResStock_Version' in versions.keys(): - stock_version = versions['ResStock_Version'] - elif 'ComStock_Version' in versions.keys(): - stock_version = versions['ComStock_Version'] + if 'ResStock' in versions.keys(): + stock_version = versions['ResStock'] + elif 'ComStock' in versions.keys(): + stock_version = versions['ComStock'] else: stock_version = 'Unknown' val_err = f"BuildStockBatch version {BuildStockBatch_Version} or above is required" \ diff --git a/buildstockbatch/test/test_validation.py b/buildstockbatch/test/test_validation.py index 858eee88..70025ddf 100644 --- a/buildstockbatch/test/test_validation.py +++ b/buildstockbatch/test/test_validation.py @@ -290,7 +290,7 @@ def test_number_of_options_apply_upgrade(): @resstock_required def test_validate_resstock_or_comstock_version(mocker): # Set the version to a 'really old' one so we trigger the version check error - mocker.patch("buildstockbatch.base.bsb_version", "0.1") + mocker.patch("buildstockbatch.base.bsb_version", "1.0.0") proj_filename = resstock_directory / "project_national" / "national_upgrades.yml" with pytest.raises(ValidationError): BuildStockBatchBase.validate_resstock_or_comstock_version(str(proj_filename)) diff --git a/docs/changelog/changelog_2023_10_0.rst b/docs/changelog/changelog_2023_10_0.rst new file mode 100644 index 00000000..df9584f2 --- /dev/null +++ b/docs/changelog/changelog_2023_10_0.rst @@ -0,0 +1,84 @@ +==================== +v2023.10.0 Changelog +==================== + +.. changelog:: + :version: v2023.10.0 + :released: 2023-10-17 + + .. change:: + :tags: general, bugfix + :pullreq: 387 + :tickets: 385 + + Removing broken postprocessing tests. + + .. change:: + :tags: general, bugfix + :pullreq: 384 + + Introduce '*' as a valid option name in options_lookup.tsv to indicate a + parameter that can take any option and don't need to pass arguments to + measures. Enables buildstock.csv validation for ComStock without blowing + up the size of the options_lookup.tsv file. + + .. change:: + :tags: bugfix + :pullreq: 386 + :tickets: 256 + + No longer automatically downloads the appropriate singularity image from + S3. Also added validation to ensure the image is in the correct location. + + .. change:: + :tags: general, feature + :pullreq: 382 + + For the Residential HPXML Workflow Generator, add a new ``detailed_filepath`` argument + for pointing to user-specified TSV file of electricity tariff file paths. The TSV file can contain + utility rates mapped by State, or any other parameter. + + .. change:: + :tags: general, feature + :pullreq: 383 + + For the Residential HPXML Workflow Generator, fixes new ``include_annual_resilience`` argument to true and + adds a new optional ``include_timeseries_resilience`` argument that defaults to false. Also fixes new + ``include_annual_bills`` argument to true and ``include_monthly_bills`` argument to false. + + .. change:: + :tags: postprocessing, feature + :pullreq: 365 + + Upload buildstock.csv to S3 during postprocessing + + .. change:: + :tags: feature + :pullreq: 396 + :tickets: 377 + + Allow fractional ``eagle.minutes_per_sim`` for simulations that run less + than a minute. Making that it a required input. + + .. change:: + :tags: comstock, workflow + :pullreq: 399 + + Remove default addition of SimulationOutputReport from ComStock workflow generator to avoid multiple instances + when also included in YML. SimulationOutputReport measure must be included in YML to be added to workflow. + + .. change:: + :tags: eagle, bugfix + :tickets: 393 + :pullreq: 397 + + Updating validation for Eagle output directory to include + ``/lustre/eaglefs`` directories. + + .. change:: + :tags: eagle, bugfix + :pullreq: 398 + :tickets: 390 + + No longer errors out with a "no space left on device" when using the + ``weather_files_url`` on Eagle. diff --git a/docs/changelog/changelog_dev.rst b/docs/changelog/changelog_dev.rst index eef16424..75eeab3d 100644 --- a/docs/changelog/changelog_dev.rst +++ b/docs/changelog/changelog_dev.rst @@ -14,80 +14,3 @@ Development Changelog This is an example change. Please copy and paste it - for valid tags please refer to ``conf.py`` in the docs directory. ``pullreq`` should be set to the appropriate pull request number and ``tickets`` to any related github issues. These will be automatically linked in the documentation. - - .. change:: - :tags: general, bugfix - :pullreq: 387 - :tickets: 385 - - Removing broken postprocessing tests. - - .. change:: - :tags: general, bugfix - :pullreq: 384 - - Introduce '*' as a valid option name in options_lookup.tsv to indicate a - parameter that can take any option and don't need to pass arguments to - measures. Enables buildstock.csv validation for ComStock without blowing - up the size of the options_lookup.tsv file. - - .. change:: - :tags: bugfix - :pullreq: 386 - :tickets: 256 - - No longer automatically downloads the appropriate singularity image from - S3. Also added validation to ensure the image is in the correct location. - - .. change:: - :tags: general, feature - :pullreq: 382 - - For the Residential HPXML Workflow Generator, add a new ``detailed_filepath`` argument - for pointing to user-specified TSV file of electricity tariff file paths. The TSV file can contain - utility rates mapped by State, or any other parameter. - - .. change:: - :tags: general, feature - :pullreq: 383 - - For the Residential HPXML Workflow Generator, fixes new ``include_annual_resilience`` argument to true and - adds a new optional ``include_timeseries_resilience`` argument that defaults to false. Also fixes new - ``include_annual_bills`` argument to true and ``include_monthly_bills`` argument to false. - - .. change:: - :tags: postprocessing, feature - :pullreq: 365 - - Upload buildstock.csv to S3 during postprocessing - - .. change:: - :tags: feature - :pullreq: 396 - :tickets: 377 - - Allow fractional ``eagle.minutes_per_sim`` for simulations that run less - than a minute. Making that it a required input. - - .. change:: - :tags: comstock, workflow - :pullreq: 399 - - Remove default addition of SimulationOutputReport from ComStock workflow generator to avoid multiple instances - when also included in YML. SimulationOutputReport measure must be included in YML to be added to workflow. - - .. change:: - :tags: eagle, bugfix - :tickets: 393 - :pullreq: 397 - - Updating validation for Eagle output directory to include - ``/lustre/eaglefs`` directories. - - .. change:: - :tags: eagle, bugfix - :pullreq: 398 - :tickets: 390 - - No longer errors out with a "no space left on device" when using the - ``weather_files_url`` on Eagle. diff --git a/docs/changelog/index.rst b/docs/changelog/index.rst index 13e67d47..1f01db7c 100644 --- a/docs/changelog/index.rst +++ b/docs/changelog/index.rst @@ -11,14 +11,15 @@ Current Migration Guide .. toctree:: :titlesonly: - migration_2023_06_0 + migration_2023_10_0 -Change logs ------------ +Changelogs +---------- .. toctree:: :titlesonly: + changelog_2023_10_0 changelog_2023_06_0 changelog_2023_05_0 changelog_2023_01_0 @@ -47,6 +48,7 @@ Older Migration Guides .. toctree:: :titlesonly: + migration_2023_06_0 migration_2023_05_0 migration_2023_01_0 migration_2022_12_0 diff --git a/docs/changelog/migration_2023_10_0.rst b/docs/changelog/migration_2023_10_0.rst new file mode 100644 index 00000000..63e1f9eb --- /dev/null +++ b/docs/changelog/migration_2023_10_0.rst @@ -0,0 +1,41 @@ +.. |version| replace:: v2023.10.0 + +======================================= +What's new in buildstockbatch |version| +======================================= + +.. admonition:: About this Document + + This document describes changes between buildstockbatch version 2022.06.0 and + buildstockbatch version |version| + +General +======= + +This version should be backwards compatible with previous versions of +buildstockbatch. + +See :doc:`changelog_2023_10_0` for details of this change. + +This update primarily addresses bugfixes and issues with the Local and Eagle +implementations. Updates to support Kestrel and AWS will be part of +future versions. + +Schema Updates +============== + +The constraint on the ``minutes_per_sim`` key under the ``eagle`` section of the +schema was relaxed from two hours to eight hours. This change is backwards +compatible as it makes an existing validation constraint less restrictive. It is +now a required inputs, whereas it used to default to 3. + +An optional ``max_minutes_per_sim`` argument was added. If it is present, if any +particular simulation takes longer than the amount of time specified, it will be +terminated. + +Residential HPXML Workflor Generator Changes +============================================ + +Updates were made to workflow generator arguments to add new ``detailed_filepath`` +and ``include_timeseries_resilience`` arguments, see +:doc:`../workflow_generators/residential_hpxml` for details. diff --git a/docs/changelog/migration_dev.rst b/docs/changelog/migration_dev.rst index b650d33a..a2b07fd7 100644 --- a/docs/changelog/migration_dev.rst +++ b/docs/changelog/migration_dev.rst @@ -6,7 +6,7 @@ What's new in buildstockbatch |version| .. admonition:: About this Document - This document describes changes between buildstockbatch version 2022.01.0 and + This document describes changes between buildstockbatch version 2022.10.0 and buildstockbatch version |version| General @@ -20,7 +20,4 @@ See :doc:`changelog_dev` for details of this change. Schema Updates ============== -The constraint on the ``minutes_per_sim`` key under the -``eagle`` section of the schema was relaxed from two hours to eight hours. -This change is backwards compatible as it makes an existing validation -constraint less restrictive. +Add as changes are made. diff --git a/docs/installation.rst b/docs/installation.rst index edc910a3..fb920e64 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -184,6 +184,11 @@ The ``-d`` and ``-e`` flags can also be combined if desired Amazon Web Services (Beta) ~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. warning:: + + The AWS version of buildstockbatch is currently broken. A remedy is in + progress. Thanks for your patience. + The installation instructions are the same as the :ref:`local-install` installation. You will need to use an AWS account with appropriate permissions. The first time you run ``buildstock_aws`` it may take several minutes, diff --git a/setup.py b/setup.py index c51b67a2..bb37c4d0 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,8 @@ 'yamale', 'ruamel.yaml', 'awsretry', - 'lxml' + 'lxml', + 'semver' ], extras_require={ 'dev': [