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

feat: merge mvp branch into develop #89

Merged
merged 107 commits into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
6f14f82
chore: add __init__ file
danielolsen May 5, 2021
4011983
chore: add requirements.txt with pandas
danielolsen May 5, 2021
fe66da5
chore: add const.py file
danielolsen May 5, 2021
67474d3
chore: add skeleton for grid_to_switch function
danielolsen May 5, 2021
ce01306
Merge pull request #17 from Breakthrough-Energy/daniel/add_skeleton
danielolsen May 5, 2021
a92b9be
chore: add feature request template (#23)
danielolsen May 6, 2021
af13c4e
chore: add import os
danielolsen May 5, 2021
bad3cef
chore: add transmission_parameters to const.py
danielolsen May 5, 2021
8f1f2d6
feat: add logic to build_trans_params
danielolsen May 5, 2021
0a5aa91
Merge pull request #19 from Breakthrough-Energy/daniel/trans_params
danielolsen May 6, 2021
bf635c5
fix: correct typo in load_zones_filepath construction
danielolsen May 6, 2021
43b8e85
chore: add load constants
danielolsen May 5, 2021
cc8cf7c
feat: add logic to build_load_zones
danielolsen May 5, 2021
687bf5f
Merge pull request #20 from Breakthrough-Energy/daniel/load_zones
danielolsen May 6, 2021
e359e25
chore: add financial parameters to const.py
danielolsen May 5, 2021
8408a55
feat: add get_base_year function
danielolsen May 5, 2021
563bc54
feat: add logic to build_financials
danielolsen May 5, 2021
542135a
Merge pull request #21 from Breakthrough-Energy/daniel/financials
danielolsen May 6, 2021
9b64242
chore: add fuels to const.py
danielolsen May 5, 2021
76ad2ae
feat: add logic to build_fuels
danielolsen May 5, 2021
2ad6206
Merge pull request #22 from Breakthrough-Energy/daniel/fuels
danielolsen May 6, 2021
c6abd15
feat: add function to create data frame for periods
BainanXia May 6, 2021
9cc1bc6
fix: change type of const.fuels from set to list (#28)
danielolsen May 6, 2021
669506d
chore: add non fuel energy source to const.py
BainanXia May 6, 2021
857ab2f
feat: add logic to build_non_fuel_energy_sources
BainanXia May 6, 2021
34313c9
Merge pull request #27 from Breakthrough-Energy/bainan/non_fuel_energ…
BainanXia May 6, 2021
44256ed
chore: add investment_costs_by_type to const.py
danielolsen May 5, 2021
f684f7f
chore: add assumed_pmins to const
danielolsen May 5, 2021
55b5f6c
feat: add linearize_gencost function
danielolsen May 6, 2021
3969b76
feat: add linearize_gencost call to grid_to_switch
danielolsen May 6, 2021
0389d85
refactor: change call signature of build_gen_build_costs from within …
danielolsen May 6, 2021
182ef50
feat: add logic to build_gen_build_costs function
danielolsen May 6, 2021
da3c45d
Merge pull request #26 from Breakthrough-Energy/daniel/gen_build_costs
danielolsen May 6, 2021
0f60228
fix: pass required bus parameter to build_load_zones
danielolsen May 6, 2021
9979bfe
fix: run os.makedirs on outputfolder for robustness (#30)
danielolsen May 6, 2021
a870557
fix: fix lambda function in linearize_gencost
danielolsen May 7, 2021
910cc31
fix: call signature for gen_build_costs within grid_to_switch
danielolsen May 7, 2021
40c1cad
fix for overnight_costs in build_gen_build_costs
danielolsen May 7, 2021
397040c
Merge pull request #31 from Breakthrough-Energy/daniel/gen_build_cost…
danielolsen May 7, 2021
bf08ad7
feat: add function to calculate branch efficiency
BainanXia May 7, 2021
a092ab2
chore: add assumed_branch_efficiencies to const.py
BainanXia May 7, 2021
beeb496
feat: add function to create data frame for ac lines
BainanXia May 7, 2021
8d934c8
feat: add function to create data frame for dc lines
BainanXia May 7, 2021
472ef68
feat: add logic to build_transmission_lines function
BainanXia May 7, 2021
da5c83e
chore: add haversine into requirements.txt
BainanXia May 7, 2021
9e45a7e
chore: add bug_report issue template (#34)
danielolsen May 7, 2021
229ce25
Merge pull request #33 from Breakthrough-Energy/bainan/transmission_l…
BainanXia May 7, 2021
29a5144
chore: add fuel_mappings to const.py
danielolsen May 6, 2021
1ba6fe7
refactor: change return type of get_base_year
danielolsen May 6, 2021
32c0ccc
refactor: change return of get_inv_periods from list of str to list o…
danielolsen May 6, 2021
7a368cf
feat: add logic to build_fuel_cost function
danielolsen May 6, 2021
d9fef8f
feat: update call signature for build_fuel_cost within grid_to_switch
danielolsen May 7, 2021
aaff505
refactor: move calculation of average fuel cost to separate function
danielolsen May 7, 2021
60cee6f
Merge pull request #32 from Breakthrough-Energy/daniel/fuel_cost
danielolsen May 7, 2021
41eef34
feat: add logic to build_gen_build_predetermined function
BainanXia May 7, 2021
7cb08ee
fix: update call signature for build_transmission_lines
BainanXia May 7, 2021
e802fa9
Merge pull request #36 from Breakthrough-Energy/bainan/gen_build_pred…
danielolsen May 7, 2021
bef7afa
chore: add assumed_capacity_limits to const.py
danielolsen May 7, 2021
70711f5
chore: add assumed_fuel_share_of_gencost to const.py
danielolsen May 7, 2021
b5a57bb
chore: add assumed_ages_by_type to const.py
danielolsen May 7, 2021
d2e2da5
chore: add variable_types to const.py
danielolsen May 7, 2021
0ed83fd
chore: add baseload_types to const.py
danielolsen May 7, 2021
51c8735
feat: add logic for build_generation_projects_info function
danielolsen May 7, 2021
3fa9e8c
Merge pull request #35 from Breakthrough-Energy/daniel/generation_pro…
danielolsen May 7, 2021
7de992c
chore: add PowerSimData to requirements
May 7, 2021
33ca2c0
chore: add pytest, .gitignore, tox.ini
May 7, 2021
8217ca3
ci: add lint and test workflows
May 7, 2021
a569e5a
style: apply formatting
May 7, 2021
b7e4795
test: add placeholder and simplify tox.ini
May 7, 2021
58077dc
Merge pull request #37 from Breakthrough-Energy/jon/reqs
jenhagg May 7, 2021
6aaeaac
chore: add entries to fuel_mapping to cover 'dfo' and 'other' types (…
danielolsen May 18, 2021
3fc430b
chore: update requirements.txt
danielolsen May 18, 2021
20f112b
chore: add Pipfile
danielolsen May 18, 2021
61e43b5
chore: add Pipfile.lock
danielolsen May 18, 2021
c112dac
Merge pull request #54 from Breakthrough-Energy/daniel/requirements
danielolsen May 18, 2021
380226f
chore: add pull request template (#58)
danielolsen May 19, 2021
35c2e1b
doc: add docstring to grid_to_switch (#57)
danielolsen May 20, 2021
1b3d6e1
feat: add skeleton for applying temporal mapping to inputs (#56)
danielolsen May 20, 2021
c7358ed
fix: correct column co2_intensity entry in fuels.csv (#59)
YifanLi86 May 24, 2021
c3d1e72
feat: add logic to build_loads function (#61)
danielolsen May 24, 2021
6f6638a
refactor: change expected type of timepoints from Series to DataFrame
danielolsen May 20, 2021
f6938e0
feat: add logic to build_timeseries function
danielolsen May 20, 2021
9384b58
refactor: change call signatures of functions to take consolidated ti…
danielolsen May 24, 2021
b6411cd
feat: add logic to write timepoints.csv file
danielolsen May 24, 2021
a10911f
Merge pull request #63 from Breakthrough-Energy/daniel/build_timeseries
danielolsen May 24, 2021
fde864e
feat: add logic to build_variable_capacity_factors function
danielolsen May 21, 2021
c75d6ba
feat: add make_indices function to standarize between grid_to_switch …
danielolsen May 24, 2021
bbddcfa
refactor: use make_indices function within grid_to_switch
danielolsen May 24, 2021
2ed3255
refactor: use make_indices function within profiles_to_switch
danielolsen May 24, 2021
e3c7b62
Merge pull request #64 from Breakthrough-Energy/daniel/build_variable…
danielolsen May 24, 2021
a1229a2
feat: add main user-facing preparation script
danielolsen May 25, 2021
02799aa
refactor: move timepoint checking to main prepare function
danielolsen May 26, 2021
11236ae
refactor: move creation of outputfolder to main prepare function
danielolsen May 26, 2021
d295e12
Merge pull request #71 from Breakthrough-Energy/daniel/prepare_script
danielolsen May 26, 2021
2f53a16
fix: correct bug when setting index name (#74)
danielolsen May 26, 2021
2296c3b
fix: correct column order for loads.csv (#72)
danielolsen May 26, 2021
8de0d33
fix: assign heat rates of '.' for variable and geothermal type plants…
danielolsen May 26, 2021
9fc28fb
feat: add function to write modules.txt file (#77)
danielolsen May 26, 2021
7ad83c0
fix: add 'g' to beginning of predetermined gen build indices (#78)
danielolsen May 26, 2021
299baab
fix: don't write fuel costs for non-fuels (e.g. geothermal) (#79)
danielolsen May 26, 2021
725cd13
feat: write version identifier for Switch (#76)
danielolsen May 26, 2021
fe3f825
fix: correct a few file and column names/order (#66)
YifanLi86 May 26, 2021
c772a25
fix: change type of AC lines indices to be str to match DC lines (#81)
danielolsen May 26, 2021
622bca7
fix: replace capacity limit values for existing generators with '.' (…
danielolsen May 27, 2021
4ee1ffa
refactor: rename folder parameter of prepare_inputs function (#85)
danielolsen May 27, 2021
bf9ff9c
feat: save grid in pickle file for use in output processing (#86)
danielolsen May 27, 2021
859b699
feat: add call script (#84)
danielolsen Jun 1, 2021
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
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Bug report
about: Create a report to help us improve
title: Bug report
labels: bug
assignees: ahurli, BainanXia, danielolsen, jon-hagg, rouille

---

# :beetle:

- [ ] I have checked that this issue has not already been reported.


### Bug summary
A short 1-2 sentences that succinctly describes the bug.

### Code for reproduction
A minimum code snippet required to reproduce the bug. Please make sure to minimize the
number of dependencies required.
```python
# Paste your code here
#
#
```

### Actual outcome
The output produced by the above code, which may be a screenshot, console output, etc.
```shell
# If applicable, paste the console output here
#
#
```

### Expected outcome
A description of the expected outcome from the code snippet.

### Environment
Please specify your platform and versions of the relevant libraries you are using:
* Operating system:
* SwitchWrapper revision (run `git rev-parse origin/HEAD`):
* Python version:
* Jupyter version (if applicable):
* Other libraries:

### Additional context
Add any other context about the problem here.
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Feature request
about: Suggest an idea for this project
title: Feature request
labels: feature request
assignees: ahurli, BainanXia, danielolsen, jon-hagg, rouille

---

# :rocket:

- [ ] Is your feature request essential for your project?


### Describe the workflow you want to enable
A clear and concise description of what can be enhanced, e.g., "I wish I could do [...]"

### Describe your proposed implementation
This should provide a description of the feature request, e.g.:
* "The class `Foo` should have a new method `bar` that allows to [...]"
* "Function `foo` needs a new arguments `bar` to set [...]"
* "Create a new function `foo` to calculate [...]"

If applicable, try to write a docstring for the desired feature. To illustrate, if you would like to add a new function in a module, provide:
* the name of the function
* a description of the task accomplished by the function
* a list of the input and output parameters together with their types (e.g., `int`,
`str`, `pandas.DataFrame`, etc.) and a short description of its/their meaning

### Describe alternatives you've considered, if relevant
This should provide a description of any alternative solutions or features you've
considered.

### Additional context
Add any other context or screenshots in this section, e.g., a plot from an article you
believe would clearly communicate results.
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[Pull Request doc](https://breakthrough-energy.github.io/docs/user/git_guide.html#d-pull-request)

### Purpose
What is the larger goal of this change?

### What the code is doing
How is the purpose executed?

### Testing
How did you test this change (unit/functional testing, manual testing, etc.)?

### Where to look
* It's helpful to clarify where your new code lives if you moved files around or there could be confusion/

* What files are most important?

### Usage Example/Visuals
How the code can be used and/or images of any graphs, tables or other visuals (not always applicable).

### Time estimate
How long will it take for reviewers and observers to understand this code change?
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Lint

on: push

jobs:
formatting:
if: "!contains(github.event.head_commit.message, 'skip_ci')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: python -m pip install --upgrade tox
- run: tox -e checkformatting
flake8:
if: "!contains(github.event.head_commit.message, 'skip_ci')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: python -m pip install --upgrade tox
- run: tox -e flake8
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Pytest

on: [push]

jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip_ci')"

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]

steps:
- name: Checkout SwitchWrapper
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- run: python -m pip install --upgrade tox
- run: tox -e pytest
139 changes: 139 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# The remainder of this file taken from github/gitignore
# https://github.com/github/gitignore/blob/master/Python.gitignore


# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Editors
.vscode/
.idea/

# Mac/OSX
.DS_Store

# Windows
Thumbs.db
14 changes: 14 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
black = "*"
pytest = "*"

[packages]
haversine = "~=2.3"
pandas = "~=1.2"
powersimdata = {editable = true, git = "https://github.com/Breakthrough-Energy/PowerSimData"}
switch-model = "==2.0.6"
Loading