-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use toml setup (#47) * use modern packaging format, and update to opendssdirect.py v0.7.0 * update readme with additional guidance for linting/formatting/etc * pre-commit configs * bump ruff & black versions in pre-commit * remove license from dynamic pyproject setup because illegal, apparently * move opendssdirect.py upgrade to #48 * Run pre commit (#50) * remove ruff from pre-commit * formatting by black * the ruff alerts in update_licenses are acceptable and should be ignored * address ruff concerns in cli * ignore more linting warnings in read.py * address (in some cases ignore) linting in read.py * remove "ub" parameter from _get_xfmr_overloads() in urbanopt_ditto_reader.py * ignore complexity linting in urbanopt_ditto_reader.py as well * address (in some cases ignore) linting in urbanopt_ditto_reader.py * Tests (#48) * new empty test files * new empty github actions ci config file * update release instructions for new package style * add .ruff_cache to gitignore * add newline at end of changelog file * add rnm output for testing * tiny word change in readme * remove license from dynamic section in pyproject.toml * remove example/test output from git cache/tracking * different path for example/test output in gitignore file * remove example/test transformers from git cache/tracking * Revert "remove example/test transformers from git cache/tracking" This reverts commit 0d21c1c. * allow command line flags to override config file * adjust line-length to 90 characters * fix typo in cli help text * remove unnecessary test file * rename test file * comment why reopt test is commented out * set up github actions for ci * set python >= 3.8 in ci. needed for pre-commitv3 * set python >= 3.8 in repo * restore license file accidentally deleted * fix local import statement to match some historical refactor * change line-length to 120 chars to not have so many line-breaks * raise SystemExit cleanly for elegant warning to user * allow user args to override json config appropriately * ignore a few more lint checks in the test suite * add subprocess check to test calls * remove test output from git * run ci weeknights and on PR review request * bump ditto-reader to v0.6.0 and black/pre-commit versions * use opendssdirect.py v0.8 * make cli error message an f-string like it is supposed to be * slightly better way of confirming rnm workflow ran correctly * update ruff to 0.1.0 * use correct min Python version in readme * update linting dependencies in pre-commit * update checkout action version in CI, and add detail to step names * use traitlets <5.10 due to breaking change found in ditto.py * declare support for Python3.12 * rounding outputs to 5 decimal places * run CI on push instead of schedule * `black` formatting * autoupdate pre-commit hook versions * un-ignore opendss files * regenerate example opendss files by running the test suite * use 2 hour timestep in test * regen opendss files at 2 hour timestep --------- Co-authored-by: tarekelgindy <tarek.elgindy@nrel.gov> --------- Co-authored-by: tarekelgindy <tarek.elgindy@nrel.gov> --------- Co-authored-by: tarekelgindy <tarek.elgindy@nrel.gov> * remove outdated opendssdirect.py installation recommendation * Cleaner dependencies (#51) * traitlets issue fixed in ditto.py * use ruff formatter instead of black * ignore a rule when using ruff formatter * apply ruff formatter * bump ruff, remove black, reinstate traitlets restriction until ditto releases * depend on ditto@master instead of released version - TEMPORARY * use ditto.py fork containing bugfix * use released version of ditto.py, hooray! * New workflow to publish to pypi when we release on github (#52) * WIP: new workflow to publish to pypi when we release on github [skip ci] * update readme with new release instructions --------- Co-authored-by: tarekelgindy <tarek.elgindy@nrel.gov>
- Loading branch information
Showing
247 changed files
with
306,687 additions
and
47,369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | ||
name: ci | ||
on: | ||
push: | ||
# schedule: | ||
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule | ||
# 5:20 am UTC (11:20pm MDT the day before) every weekday night in MDT | ||
# - cron: '20 5 * * 2-6' | ||
# pull_request: | ||
# types: [review_requested] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest] | ||
python-version: ["3.8", "3.12"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install ditto-reader | ||
run: pip install .[dev] | ||
- name: Run pre-commit to confirm linting and formatting | ||
# https://github.com/pre-commit/action | ||
uses: pre-commit/action@v3.0.0 | ||
with: | ||
extra_args: --all-files | ||
- name: Run unit tests | ||
run: python -Wonce::DeprecationWarning -Im pytest -vv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: PyPIRelease | ||
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.12 | ||
|
||
- name: Install pypa/build | ||
run: >- | ||
python3 -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: python3 -m build | ||
|
||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
release: | ||
name: >- | ||
Publish Python 🐍 distribution 📦 to PyPI | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: release | ||
url: https://pypi.org/p/urbanopt-ditto-reader | ||
permissions: | ||
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-ast | ||
- id: check-added-large-files | ||
args: ['--maxkb=2000'] | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: check-json | ||
- id: name-tests-test | ||
args: ["--pytest-test-first"] | ||
- id: fix-byte-order-marker | ||
- id: check-case-conflict | ||
- id: check-docstring-first | ||
- id: check-executables-have-shebangs | ||
- id: check-merge-conflict | ||
- id: debug-statements | ||
# - id: detect-aws-credentials | ||
- id: detect-private-key | ||
# - repo: meta | ||
# hooks: | ||
# - id: check-useless-excludes # Ensure the exclude syntax is correct | ||
# - id: check-hooks-apply # Fails if a hook doesn't apply to any file | ||
# Run the Ruff linter | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.1.6 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
types_or: [python, pyi, jupyter] | ||
# Run the Ruff formatter | ||
# https://docs.astral.sh/ruff/integrations/#pre-commit | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.1.6 | ||
hooks: | ||
- id: ruff-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1801,7 +1801,7 @@ | |
] | ||
} | ||
} | ||
|
||
|
||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
New CNDATA.UG_AL_750kcmil_15_kV InsLayer=0.01 DiaIns=0.0420218 k=24 DiaStrand=0.0020499999999999997 Rstrand=0.0058592 Diam=0.022021799999999998 DiaCable=0.04572 Rac=7.549999999999999e-05 GmrStrand=0.0007994 GMRac=0.008575300000000001 Runits=m Radunits=m GMRunits=m | ||
|
1 change: 0 additions & 1 deletion
1
example/run/baseline_scenario/opendss/dss_files/LineGeometry.dss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
New LineGeometry.Geometry_1 Nconds=4 Nphases=3 Units=m Cond=1 Wire=OH_ACSR_477kcmil X=0.0 H=10.0 Normamps=660.0 Cond=2 Wire=OH_ACSR_477kcmil X=0.304 H=10.0 Normamps=660.0 Cond=3 Wire=OH_ACSR_477kcmil X=0.608 H=10.0 Normamps=660.0 Cond=4 Wire=OH_ACSR_477kcmil X=0.0 H=9.6952 Normamps=660.0 Reduce=y | ||
|
||
New LineGeometry.Geometry_2 Nconds=3 Nphases=3 Units=m Cond=1 CNCable=UG_AL_750kcmil_15_kV X=0.0 H=-2.0 Normamps=640.0 Cond=2 CNCable=UG_AL_750kcmil_15_kV X=0.152 H=-2.0 Normamps=640.0 Cond=3 CNCable=UG_AL_750kcmil_15_kV X=0.304 H=-2.0 Normamps=640.0 Reduce=n | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 13 additions & 14 deletions
27
example/run/baseline_scenario/opendss/dss_files/LoadShapes.dss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
New Loadshape.feature_1 npts= 8759 interval=1.0 mult = (file=..\profiles\load_1_pu.csv) | ||
New Loadshape.feature_1 npts= 8759 interval=1.0 mult = (file=../profiles/load_1_pu.csv) | ||
|
||
New Loadshape.feature_2 npts= 8759 interval=1.0 mult = (file=..\profiles\load_2_pu.csv) | ||
New Loadshape.feature_2 npts= 8759 interval=1.0 mult = (file=../profiles/load_2_pu.csv) | ||
|
||
New Loadshape.feature_3 npts= 8759 interval=1.0 mult = (file=..\profiles\load_3_pu.csv) | ||
New Loadshape.feature_3 npts= 8759 interval=1.0 mult = (file=../profiles/load_3_pu.csv) | ||
|
||
New Loadshape.feature_4 npts= 8759 interval=1.0 mult = (file=..\profiles\load_4_pu.csv) | ||
New Loadshape.feature_4 npts= 8759 interval=1.0 mult = (file=../profiles/load_4_pu.csv) | ||
|
||
New Loadshape.feature_5 npts= 8759 interval=1.0 mult = (file=..\profiles\load_5_pu.csv) | ||
New Loadshape.feature_5 npts= 8759 interval=1.0 mult = (file=../profiles/load_5_pu.csv) | ||
|
||
New Loadshape.feature_6 npts= 8759 interval=1.0 mult = (file=..\profiles\load_6_pu.csv) | ||
New Loadshape.feature_6 npts= 8759 interval=1.0 mult = (file=../profiles/load_6_pu.csv) | ||
|
||
New Loadshape.feature_7 npts= 8759 interval=1.0 mult = (file=..\profiles\load_7_pu.csv) | ||
New Loadshape.feature_7 npts= 8759 interval=1.0 mult = (file=../profiles/load_7_pu.csv) | ||
|
||
New Loadshape.feature_8 npts= 8759 interval=1.0 mult = (file=..\profiles\load_8_pu.csv) | ||
New Loadshape.feature_8 npts= 8759 interval=1.0 mult = (file=../profiles/load_8_pu.csv) | ||
|
||
New Loadshape.feature_9 npts= 8759 interval=1.0 mult = (file=..\profiles\load_9_pu.csv) | ||
New Loadshape.feature_9 npts= 8759 interval=1.0 mult = (file=../profiles/load_9_pu.csv) | ||
|
||
New Loadshape.feature_10 npts= 8759 interval=1.0 mult = (file=..\profiles\load_10_pu.csv) | ||
New Loadshape.feature_10 npts= 8759 interval=1.0 mult = (file=../profiles/load_10_pu.csv) | ||
|
||
New Loadshape.feature_11 npts= 8759 interval=1.0 mult = (file=..\profiles\load_11_pu.csv) | ||
New Loadshape.feature_11 npts= 8759 interval=1.0 mult = (file=../profiles/load_11_pu.csv) | ||
|
||
New Loadshape.feature_12 npts= 8759 interval=1.0 mult = (file=..\profiles\load_12_pu.csv) | ||
|
||
New Loadshape.feature_13 npts= 8759 interval=1.0 mult = (file=..\profiles\load_13_pu.csv) | ||
New Loadshape.feature_12 npts= 8759 interval=1.0 mult = (file=../profiles/load_12_pu.csv) | ||
|
||
New Loadshape.feature_13 npts= 8759 interval=1.0 mult = (file=../profiles/load_13_pu.csv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,4 @@ Calcvoltagebases | |
|
||
Buscoords Buscoords.dss | ||
|
||
Solve | ||
Solve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
New WireData.OH_ACSR_477kcmil GMRac=0.0088 GMRunits=m Diam=0.0218 Radunits=m normamps=660.0 Rac=0.00011999999999999999 | ||
|
Oops, something went wrong.