Skip to content

Commit

Permalink
Merge patches in main into develop (#41)
Browse files Browse the repository at this point in the history
* Enhancement: Update issue and PR templates (#35)

* update PR template to be a bit more relevant

* udpate the bug report template

* update the feature request and replace duplicated text in the bug report

* update formatting so all descriptions are html comments

* fix bad merge conflict resolution from ad7d7c8 (#40)

---------

Co-authored-by: John Jasa <[email protected]>
  • Loading branch information
RHammond2 and johnjasa authored Nov 8, 2024
1 parent cb4991a commit eb6ad27
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 158 deletions.
110 changes: 53 additions & 57 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,77 +6,73 @@ labels: "Type: Bug"
---

<!--
IMPORTANT NOTES
Thank you for taking the time to report a bug. If you aren't certain whether an issue
is a bug, please first open a Discussion. Before submitting, please reread your
description to ensure that other readers can reasonably understand the issue
you're facing and the impact on your workflow or results.
This form is written in GitHub's Markdown format. For a reference on this type
of syntax, see GitHub's documentation:
https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
This template contains guidance for your submission within the < ! - -, - - > blocks.
These are comments in HTML syntax and will not appear in the submission.
Be sure to use the "Preview" feature on GitHub to ensure your submission is formatted as intended.
When including code snippets, please paste the text itself and wrap the code block with
ticks (see the other character on the tilde ~ key in a US keyboard) to format it as code.
For example, Python code should be wrapped in ticks like this:
```python
def a_func():
return 1
IMPORTANT NOTES
a = 1
b = a_func()
print(a + b)
```
This is preferred over screen shots since it is searchable and others can copy/paste
the text to run it.
1. Replace all example text (contained in "<>") or anywhere specifically commenting to replace the
text, leaving any guiding HTML comments in place (formatted like this large block so it won't
show up in your Bug Report text.)
2. Use GH flavored markdown: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax,
especially for code snippets, which should look like the following:
```python
a = 1
b = 2
print(a + b)
```
3. Please be as thorough as possible when describing what went wrong, and what was expected from a
correct solution. The amount of information required to describe the bug may differ, but more
information is always helpful to ensure you receive the help you need.
-->

<!--The title should clearly define the issue succinctly.-->
# Add meaningful title here
<!--
A clear and concise description of the bug including what happened
and what you expected to happen.
-->

<!-- Describe your bug/issue here using as much detail as necessary. -->


## How to reproduce
<!--
Describe how another person with no context can recreate this issue.
It is typically very helpful to reduce the problem as much as possible
and share a minimum working example. See the note above on including
code as text rather than screenshots.
-->

<!-- Describe how another person with no context can recreate this issue. -->


## Relevant output
<!--
Include any output, plots, or other means of communication here to add context to the problem.
-->

## GreenHEART version
<!--
Share your GreenHEART version and how you installed it. You can print the GreenHEART version from
a Python REPL or script with these commands:
```python
import greenheart
print(greenheart.__version__)
```
-->
<!-- Include any output, plots, tracebacks, or other means of communication here to add context to
the problem. All code and full tracebacks should be properly markdown formatted. -->


## System Information
<!-- Add your information here. -->
- OS: <e.g. Ubuntu 20.04 or macOS 10.12>
- Python version: <Result of `python --version`>
- Relevant library versions, from the results of `pip freeze`, for example:
- FLORIS
- HOPP
- matplotlib
- NREL-PySAM
- numpy
- numexpr
- orbit-nrel
- pandas
- scipy
- shapely
- OS: <macOS 12.4>
<!-- e.g. Ubuntu 20.04 or macOS 10.12 -->
- Python version: <3.10.4>
<!-- All OS: `python --version`-->
- GreenHEART version: <0.1.1>
<!--
Unix: pip freeze | grep greenheart | awk -F"git@" '/git@/{print $2}' | awk -F"#egg" '/#egg/{print $1}'
Windows: `pip list --format freeze | findstr greenheart`
-->
- <Installed from source using an editable installation with developer tools: `pip install -e .[develop]`>
- Commit hash: <commit-hash>
<!--
Unix: `pip freeze | grep greenheart | awk -F"git@" '/git@/{print $2}' | awk -F"#egg" '/#egg/{print $1}'`
Windows: `pip freeze | findstr greenheart`, then copy the full git hash between "git@" and "#egg"
-->

### Relevant library versions
<!--
Use `pip freeze` to gather the relevant versions, and use the markdown table formatting as
demonstrated below to replacing all relavant packages and their versions.
-->

| Package | Version |
| ------- | ------- |
| hopp | <3.1.1> |
| numpy | <1.26.4> |
| Pyomo | <6.8.0> |
| scipy | <1.14.1> |
| <another-relevant-package> | <version> |
61 changes: 25 additions & 36 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,52 +6,41 @@ labels: 'Type: Enhancement'
---

<!--
IMPORTANT NOTES
Thank you for taking the time to suggest a feature. Before submitting,
please reread your description to ensure that other readers can reasonably
understand the motivation and proposed solution.
This form is written in GitHub's Markdown format. For a reference on this type
of syntax, see GitHub's documentation:
https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
This template contains guidance for your submission within the < ! - -, - - > blocks.
These are comments in HTML syntax and will not appear in the submission.
Be sure to use the "Preview" feature on GitHub to ensure your submission is formatted as intended.
When including code snippets, please paste the text itself and wrap the code block with
ticks (see the other character on the tilde ~ key in a US keyboard) to format it as code.
For example, Python code should be wrapped in ticks like this:
```python
def a_func():
return 1
a = 1
b = a_func()
print(a + b)
```
This is preferred over screen shots since it is searchable and others can copy/paste
the text to run it.
IMPORTANT NOTES
1. Leave all HTML comments in place (formatted like this large block so it won't show up in
your Feature Request text.)
2. Use GH flavored markdown: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax,
especially for code snippets, which should look like the following:
```python
a = 1
b = 2
print(a + b)
```
3. Please be as thorough as possible when describing what the proposed enhancement or feature should
do, including any finer details to guide implementation.
-->

<!--The title should clearly define the feature request/enhancement succinctly.-->
# Add meaningful title here
<!--
High level description of the feature request including motivation and background.
-->

<!-- Describe the desired enhancement. -->


## Proposed solution
<!--
Here's an opportunity to prototype a feature. Please include pseudocode, images, or
any other visual aids to communicate the idea.
-->

<!-- Please include pseudocode (markdown-formatted), images, or any other visual aids to communicate the idea. -->


## Alternatives considered
<!--
Describe workarounds or alternatives even if hacky or incomplete.
-->

<!-- Describe workarounds or alternatives even if hacky or incomplete. Sometimes these are the best solution! -->


## Additional context
<!--
Optional. Provide anything else that helps to communicate the idea here.
-->

<!-- Provide anything else that helps to communicate the idea here. -->
94 changes: 48 additions & 46 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,69 +2,71 @@
<!--
IMPORTANT NOTES
Is this pull request ready to be merged?
- Do the existing tests pass and new tests added for new code?
- Is all development in a state where you are proud to share it with others and
willing to ask other people to take the time to review it?
- Is it documented in such a way that a review can reasonably understand what you've
done and why you've done it? Can other users understand how to use your changes?
If not but opening the pull request will facilitate development, make it a "draft" pull request
This form is written in GitHub's Markdown format. For a reference on this type
of syntax, see GitHub's documentation:
https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
This template contains guidance for your submission within the < ! - -, - - > blocks.
These are comments in HTML syntax and will not appear in the submission.
Be sure to use the "Preview" feature on GitHub to ensure your submission is formatted as intended.
When including code snippets, please paste the text itself and wrap the code block with
ticks (see the other character on the tilde ~ key in a US keyboard) to format it as code.
For example, Python code should be wrapped in ticks like this:
```python
def a_func():
return 1
a = 1
b = a_func()
print(a + b)
```
This is preferred over screen shots since it is searchable and others can copy/paste
the text to run it.
-->
1. Use GH flavored markdown when writing your description:
https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
2. If all boxes in the PR Checklist cannot be checked, this PR should be marked as a draft.
# Add meaningful title here
<!--
Be sure to title your pull request so that readers can scan through the list of PR's and understand
what this one involves. It should be a few well selected words to get the point across. If you have
a hard time choosing a brief title, consider splitting the pull request into multiple pull requests.
Keep in mind that the title will be automatically included in the release notes.
-->
Describe your feature here.
3. DO NOT DELTE ANYTHING FROM THIS TEMPLATE. If a section does not apply to you, simply write
"N/A" in the description.
## Related issue
<!--
If one exists, link to a related GitHub Issue.
4. Code snippets to highlight new, modified, or problematic functionality are highly encouraged,
though not required. Be sure to use proper code higlighting as demonstrated below.
```python
def a_func():
return 1
a = 1
b = a_func()
print(a + b)
```
-->

<!--The title should clearly define your contribution succinctly.-->
# Add meaningful title here

<!-- Describe your feature here. Please include any code snippets or examples in this section. -->


## PR Checklist

<!--Tick these boxes if they are complete, or format them as "[x]" for the markdown to render. -->
- [ ] `CHANGELOG.md` has been updated to describe the changes made in this PR
- [ ] Documentation
- [ ] Docstrings are up-to-date
- [ ] Related `docs/` files are up-to-date, or added when necessary
- [ ] Documentation has been rebuilt successfully
- [ ] Examples have been updated
- [ ] Tests pass (If not, and this is expected, please elaborate in the tests section)
- [ ] PR description thoroughly describes the new feature, bug fix, etc.

## Related issues

<!--If one exists, link to a related GitHub Issue.-->


## Impacted areas of the software

<!--
List any modules or other areas which should be impacted by this pull request. This helps to
determine the verification tests.
Replace the below example with any added or modified files, and briefly describe what has been changed or added, and why.
-->
- `path/to/file.extension`
- `method1`: What and why something was changed in one sentence or less.

## Additional supporting information
<!--
Add any other context about the problem here.
-->

<!--Add any other context about the problem here.-->


## Test results, if applicable

<!--
Add the results from unit tests and regression tests here along with justification for any
failing test cases.
-->


<!--
__ For NREL use __
Release checklist:
Expand Down
21 changes: 3 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,16 @@ jobs:
build:

runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
- name: Set up Miniconda Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v3
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
activate-environment: greenheart-test-${{ matrix.python-version }}
- name: Install dependencies
env:
SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL: True
Expand All @@ -34,15 +28,6 @@ jobs:
touch .env
# echo NREL_API_KEY=${{ secrets.NREL_API_KEY }} >> .env
# cat .env
- name: Save environment build details
run: |
mkdir ~/artifacts
conda env export --file ~/artifacts/environment.yml
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.python-version }}-environment
path: ~/artifacts/environment.yml
- name: Run tests
run: |
PYTHONPATH=. pytest tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_system_power_report(self):
comp = Compressor(p_outlet, flow_rate_kg_per_day, p_inlet=p_inlet, n_compressors=n_compressors, sizing_safety_factor=sizing_safety_factor)
comp.compressor_power()
_motor_rating, total_system_power = comp.compressor_system_power()
assert total_system_power == approx(3627.3907562149357)
assert total_system_power == 3627.3907562149357

def test_max_flow_rate_per_compressor(self):
p_inlet = 20 # bar
Expand Down

0 comments on commit eb6ad27

Please sign in to comment.