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

Bnb/dev #76

Merged
merged 62 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
40af63d
python 3.11 support added. moved execute_pytest to utilities.pytest
bnb32 Jun 28, 2024
20a8cff
test reorganization
bnb32 Jun 29, 2024
fc2bbf0
partial integration of gaps pipeline and BaseCLI from sup3r.
bnb32 Jun 30, 2024
e6f7d12
cli pipeline tests with gaps status files writing correctly
bnb32 Jun 30, 2024
6f48423
fixed status file writing in collect-data-model loop
bnb32 Jun 30, 2024
a5422e1
added checking for "successful" in status file tests
bnb32 Jun 30, 2024
e683a6a
ClassVar annotations and complexity reductions
bnb32 Jun 30, 2024
8045492
some test fixes
bnb32 Jun 30, 2024
4dfa743
update_nsrdb_versions.py script removed. nsrdb pipeline removed after…
bnb32 Jun 30, 2024
29618f5
legacy pipeline test
bnb32 Jul 1, 2024
beb3007
rev dep removed. gaps added
bnb32 Jul 1, 2024
1c7f6a3
min versions in pyproject.toml
bnb32 Jul 1, 2024
f22708a
var meta pointing to test data
bnb32 Jul 1, 2024
d1313b1
changed uw test cloud data to 2013 001 to be consistent with other te…
bnb32 Jul 1, 2024
6fa9616
some little ruff suggested edits
bnb32 Jul 1, 2024
6a8fdac
pr test workflow update
bnb32 Jul 1, 2024
d720afe
removed cli.config. improved doc strings and formatting in terminal p…
bnb32 Jul 1, 2024
b409987
guess there was a reason i removed 3.8 support
bnb32 Jul 1, 2024
39092bd
moved some ctx.obj arg definitions to method in BaseCLI
bnb32 Jul 1, 2024
628e103
some clean up of blend_files
bnb32 Jul 2, 2024
fce3f01
missed str() call in collect_data_model
bnb32 Jul 2, 2024
82500c1
removing outdated utf-8 coding header
bnb32 Jul 2, 2024
4ce19ef
integrated tmy with new cli. removed old hpc wrappers in TmyRunner
bnb32 Jul 2, 2024
8e5573f
bad replacement
bnb32 Jul 2, 2024
ef0b90b
complying with complexity limits for ruff
bnb32 Jul 2, 2024
283f463
test fix
bnb32 Jul 2, 2024
cf96db3
serial tmy option for when only one site chunk
bnb32 Jul 2, 2024
0accdf2
reverting tmy deletes to check test
bnb32 Jul 2, 2024
a99d576
some naming rule ignores added
bnb32 Jul 3, 2024
1726c26
removed serial call. why is 3.10 failing the tmy cli test now
bnb32 Jul 3, 2024
f0b7168
tmy cli test with multiple site chunks
bnb32 Jul 3, 2024
da32685
split up tmy.py. split tmy_cli test into cli and regression test
bnb32 Jul 3, 2024
a9ecaf7
variable descriptions added to h5 meta
bnb32 Jul 3, 2024
08d7152
a little `create_config_files` cleaning and TODO tags for more cli re…
bnb32 Jul 3, 2024
c5c783e
blend cli integration with new CLI setup. create config methods for c…
bnb32 Jul 3, 2024
121ebb1
create blend and agg configs tests. var descrip updates
bnb32 Jul 4, 2024
074f0fa
agg and blend cli tests
bnb32 Jul 5, 2024
d83845a
agg collect cli test
bnb32 Jul 5, 2024
7a0180e
collect blend test
bnb32 Jul 5, 2024
2bfeb35
test fix
bnb32 Jul 5, 2024
5784b2c
arg rename fix
bnb32 Jul 6, 2024
f55a772
farms >= 1.0.6 req
bnb32 Jul 6, 2024
8998d0f
test fix. log_level = DEBUG
bnb32 Jul 6, 2024
f65bb78
dhi baseline fix - changed dhi_calc in farms 1.0.6. auto gen of post …
bnb32 Jul 6, 2024
4279ba2
py3.12 added
bnb32 Jul 6, 2024
73978d8
mlclouds needs tf ~2.12 so no 3.12 for now
bnb32 Jul 6, 2024
c152a2f
2018 auto config write
bnb32 Jul 6, 2024
68e6094
create configs "full" test. a little cleaning in CreateConfigs
bnb32 Jul 7, 2024
4afe5e3
missed out_dir in write config calls
bnb32 Jul 7, 2024
71d20c0
needed to break up tmy / agg / blend with separate collect methods so…
bnb32 Jul 7, 2024
9db5f7e
default kwargs for all modules
bnb32 Jul 8, 2024
191d1ee
updated readme. tests checking all needed args are written to configs
bnb32 Jul 8, 2024
421dda7
no `getargspec` for py3.11
bnb32 Jul 8, 2024
62b2912
gaps logging
bnb32 Jul 8, 2024
40c855e
added instructions on standard nsrdb runs
bnb32 Jul 8, 2024
d4e76e0
special case dist_lim for 2018
bnb32 Jul 8, 2024
630a79a
fix: test_tmy_cli header
bnb32 Jul 8, 2024
6e36cd4
some missing arg checks for config creation
bnb32 Jul 8, 2024
c89ddf9
test fixes
bnb32 Jul 8, 2024
19eaed2
moved create configs to config dir.
bnb32 Jul 9, 2024
0b014e2
misc formatting
bnb32 Jul 9, 2024
1f8dd42
misc formatting
bnb32 Jul 9, 2024
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
2 changes: 0 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
push:
branches-ignore:
- 'gh-pages'
pull_request:
branches: [main]

jobs:
ruff:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull_request_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Pytests

on: pull_request


jobs:
build:
runs-on: ${{ matrix.os }}
Expand All @@ -15,8 +16,6 @@ jobs:
python-version: '3.10'
- os: ubuntu-latest
python-version: '3.9'
- os: ubuntu-latest
python-version: '3.8'

steps:
- uses: actions/checkout@v4
Expand All @@ -36,3 +35,4 @@ jobs:
- name: Run pytest
run: |
python -m pytest -v --disable-warnings

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ nosetests.xml
coverage.xml
*.cover
.hypothesis/
lcov.info

# Translations
*.mo
Expand Down Expand Up @@ -136,3 +137,6 @@ scratch
# Docs
docs/_build
docs/source/_autosummary

# notebooks
examples
211 changes: 108 additions & 103 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,31 @@ All-Sky.
Installation
============

1. Use conda (anaconda or miniconda with python 3.9) to create an nsrdb
environment: ``conda create --name nsrdb python=3.9``
2. Activate your new conda env: ``conda activate nsrdb``
3. Follow the steps used in the `pytest actions <https://github.com/NREL/nsrdb/blob/main/.github/workflows/pull_request_tests.yml>`_.
Option 1: Install from PIP (recommended for analysts):
------------------------------------------------------

1) These actions refer to the required repositories needed to run all tests and the commands which should be run from the local location of those repositories
2) If you plan to run without MLClouds the step associated with this repository can be skipped.
4. Test your installation:
1. Create a new environment: ``conda create --name nsrdb python=3.9``

1) Start ipython and test the following import:
``from nsrdb.data_model import DataModel``
2) Navigate to the tests/ directory and run the command: ``pytest``
2. Activate environment: ``conda activate nsrdb``

3. Install nsrdb: ``pip install NREL-nsrdb``

Option 2: Clone repo (recommended for developers)
-------------------------------------------------

1. from home dir, ``git clone git@github.com:NREL/nsrdb.git``

2. Create ``nsrdb`` environment and install package
1) Create a conda env: ``conda create -n nsrdb``
2) Run the command: ``conda activate nsrdb``
3) ``cd`` into the repo cloned in 1.
4) Prior to running ``pip`` below, make sure the branch is correct (install
from main!)
5) Install ``nsrdb`` and its dependencies by running:
``pip install .`` (or ``pip install -e .`` if running a dev branch
or working on the source code)
7) *Optional*: Set up the pre-commit hooks with ``pip install pre-commit`` and ``pre-commit install``

5. If you are a developer, also run ``pre-commit install`` in the directory
containing .pre-commit-config.yaml.


NSRDB Versions
Expand All @@ -80,34 +90,77 @@ NSRDB Versions
- Effective Date
- Data Years*
- Notes
* - 1.0.0
- 2015
- 2005-2012
- Initial release of PSM v1 (no FARMS)

- Satellite Algorithm for Shortwave Radiation Budget (SASRAB) model
- MMAC model for clear sky condition
- The DNI for cloud scenes is then computed using the DISC model

* - 2.0.0
- 2016
- 1998-2015
- Initial release of PSM v2 (use of FARMS, downscaling of ancillary data
introduced to account for elevation, NSRDB website distribution
developed)

- Clear sky: REST2, Cloudy sky: NREL FARMS model and DISC model
- Climate Forecast System Reanalysis (CFSR) is used for ancillary data
- Monthly 0.5º aerosol optical depth (AOD) for 1998-2014 using
satellite and ground-based measurements. Monthly results interpolated
to daily 4-km AOD data. Daily data calibrated using ground
measurements to develop accurate AOD product.

* - 4.0.0
- 5/1/23
- 2022
- Integrated new FARMS-DNI model.
* - 3.2.3
- 4/13/23
- None
- Fixed MERRA interpolation issue #51 and deprecated python 3.7/3.8.
Added changes to accommodate pandas v2.0.0.
* - 3.2.2
- 2/25/2022
- 1998-2021
- Implemented a model for snowy albedo as a function of temperature from
MERRA2 based on the paper "A comparison of simulated and observed
fluctuations in summertime Arctic surface albedo" by Becky Ross and
John E. Walsh
* - 3.2.1
- 1/12/2021
- 2021
- Implemented an algorithm to re-map the parallax and shading corrected
cloud coordinates to the nominal GOES coordinate system. This fixes the
issue of PC cloud coordinates conflicting with clearsky coordinates.
This also fixes the strange pattern that was found in the long term
means generated from PC data.
* - 3.2.0
- 3/17/2021
- 2020
- Enabled cloud solar shading coordinate adjustment by default, enabled
MLClouds machine learning gap fill method for missing cloud properties
(cloud fill flag #7)
* - 3.1.2
- 6/8/2020
- 2020
- Added feature to adjust cloud coordinates based on solar position and
shading geometry.
* - 3.1.1
- 12/5/2019
- 2018+, TMY/TDY/TGY-2018
- Complete refactor of TMY processing code.
* - 3.1.0
- 9/23/2019
- 2018+
- Complete refactor of NSRDB processing code for NSRDB 2018
* - 3.0.6
- 4/23/2019
- 1998-2017
- Missing data for all cloud properties gap filled using heuristics method
* - 3.0.5
- 4/8/2019
- 1998-2017
- Cloud pressure attributes and scale/offset fixed for 2016 and 2017
* - 3.0.4
- 3/29/2019
- 1998-2017
- Aerosol optical depth patched with physical range from 0 to 3.2
* - 3.0.3
- 2/25/2019
- 1998-2017
- Wind data recomputed to fix corrupted data in western extent
* - 3.0.2
- 2/25/2019
- 1998-2017
- Air temperature data recomputed from MERRA2 with elevation correction
* - 3.0.1
- 2018
- 2017+
- Moved from timeshift of radiation to timeshift of cloud properties.
* - 3.0.0
- 2018
- 1998-2017
- Initial release of PSM v3

- Hourly AOD (1998-2016) from Modern-Era Retrospective analysis for
Research and Applications Version 2 (MERRA2).
- Snow-free Surface Albedo from MODIS (2001-2015), (MCD43GF CMG
Expand All @@ -120,74 +173,26 @@ NSRDB Versions
- Modern-Era Retrospective analysis for Research and Applications,
Version 2 (MERRA-2) is used for ancillary data (pressure, humidity,
wind speed etc.)
* - 2.0.0
- 2016
- 1998-2015
- Initial release of PSM v2 (use of FARMS, downscaling of ancillary data
introduced to account for elevation, NSRDB website distribution
developed)
- Clear sky: REST2, Cloudy sky: NREL FARMS model and DISC model
- Climate Forecast System Reanalysis (CFSR) is used for ancillary data
- Monthly 0.5º aerosol optical depth (AOD) for 1998-2014 using
satellite and ground-based measurements. Monthly results interpolated
to daily 4-km AOD data. Daily data calibrated using ground
measurements to develop accurate AOD product.
* - 1.0.0
- 2015
- 2005-2012
- Initial release of PSM v1 (no FARMS)
- Satellite Algorithm for Shortwave Radiation Budget (SASRAB) model
- MMAC model for clear sky condition
- The DNI for cloud scenes is then computed using the DISC model

* - 3.0.1
- 2018
- 2017+
- Moved from timeshift of radiation to timeshift of cloud properties.
* - 3.0.2
- 2/25/2019
- 1998-2017
- Air temperature data recomputed from MERRA2 with elevation correction
* - 3.0.3
- 2/25/2019
- 1998-2017
- Wind data recomputed to fix corrupted data in western extent
* - 3.0.4
- 3/29/2019
- 1998-2017
- Aerosol optical depth patched with physical range from 0 to 3.2
* - 3.0.5
- 4/8/2019
- 1998-2017
- Cloud pressure attributes and scale/offset fixed for 2016 and 2017
* - 3.0.6
- 4/23/2019
- 1998-2017
- Missing data for all cloud properties gap filled using heuristics method
* - 3.1.0
- 9/23/2019
- 2018+
- Complete refactor of NSRDB processing code for NSRDB 2018
* - 3.1.1
- 12/5/2019
- 2018+, TMY/TDY/TGY-2018
- Complete refactor of TMY processing code.
* - 3.1.2
- 6/8/2020
- 2020
- Added feature to adjust cloud coordinates based on solar position and
shading geometry.
* - 3.2.0
- 3/17/2021
- 2020
- Enabled cloud solar shading coordinate adjustment by default, enabled
MLClouds machine learning gap fill method for missing cloud properties
(cloud fill flag #7)
* - 3.2.1
- 1/12/2021
- 2021
- Implemented an algorithm to re-map the parallax and shading corrected
cloud coordinates to the nominal GOES coordinate system. This fixes the
issue of PC cloud coordinates conflicting with clearsky coordinates.
This also fixes the strange pattern that was found in the long term
means generated from PC data.
* - 3.2.2
- 2/25/2022
- 1998-2021
- Implemented a model for snowy albedo as a function of temperature from
MERRA2 based on the paper "A comparison of simulated and observed
fluctuations in summertime Arctic surface albedo" by Becky Ross and
John E. Walsh
* - 3.2.3
- 4/13/23
- None
- Fixed MERRA interpolation issue #51 and deprecated python 3.7/3.8.
Added changes to accommodate pandas v2.0.0.
* - 4.0.0
- 5/1/23
- 2022
- Integrated new FARMS-DNI model.

Recommended Citation
====================
Expand Down
Loading