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

Changed all but one class method of Home to be static #292

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0e7cfc5
Rename directory
ethanstrominger Oct 23, 2024
afe0653
Rename rules-engine to python
ethanstrominger Oct 23, 2024
e3d822a
Co-authored-by: AdamFinkle <[email protected]>
ethanstrominger Oct 25, 2024
7a2a149
Merge branch 'main' of github.com:codeforboston/home-energy-analysis-…
ethanstrominger Dec 9, 2024
93d70fe
Fixed errors that CI workflow caught
AdamFinkle Dec 16, 2024
265cdad
Merge branch 'functional_programming' of github.com:stemgene/home-ene…
ethanstrominger Dec 16, 2024
ed19165
Complete merge
ethanstrominger Dec 16, 2024
db58a63
Reworked instructions about how to setup the project.
AdamFinkle Dec 17, 2024
4412fb3
Edited setup-python.sh to automatically upgrade pip
AdamFinkle Dec 17, 2024
92de869
Made _calculate_avg_summer_usage a static method
AdamFinkle Dec 17, 2024
f0174cc
Corrected errors caught by mypy
AdamFinkle Dec 19, 2024
e4c652d
Corrected an erroneous clause
AdamFinkle Dec 19, 2024
59bb3df
Moved a block inside _calculate_balance_point_and_ua to before its call.
AdamFinkle Dec 20, 2024
a74e45b
Moved two variable declarations from inside _calculate_balance_point_…
AdamFinkle Dec 20, 2024
caf79bb
Refactored internal object variable assignment to return assignment
AdamFinkle Dec 20, 2024
0edf8e2
Refactored _refine_balance_point to be a static method
AdamFinkle Dec 20, 2024
7a156cb
Refactored return of _refine_balance_point to be a dictionary
AdamFinkle Dec 20, 2024
90b693b
Squashed commit of the following:
AdamFinkle Jan 22, 2025
cacdec8
Merge branch 'main' into functional_programming
AdamFinkle Jan 22, 2025
44abece
FIxed mypy errors
AdamFinkle Jan 22, 2025
df71968
Fixed black error
AdamFinkle Jan 22, 2025
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
15 changes: 10 additions & 5 deletions python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ This is the workspace for the HEAT rules engine.
For an outline of the logic behind the rules engine and a glossary of common terms, see the [Intro to Rules Engine wiki page](https://github.com/codeforboston/home-energy-analysis-tool/wiki/Intro-to-Rules-Engine).

## Development

### Setup
Simple steps for development setup:

1. Clone the git repository.
3. Navigate to any directory and create a [virtual environment](https://docs.python.org/3/library/venv.html#creating-virtual-environments) and activate it
4. The following commands can be run from inside the rules-engine folder while the virtual environment is active
2. `pip install -e .` builds the [python egg](https://stackoverflow.com/questions/2051192/what-is-a-python-egg) for the rules engine and then installs the rules engine
3. `pip install -r requirements-dev.txt` which installs the required libraries
2. Navigate to python by typing `cd python`
3. Type `source setup-python.sh`

Then, you should be able to run `pytest` and see tests run successfully.

Then, you should be able to run `pytest`, also from any directory, and see tests run successfully.
### Continuous Integration
Type `make` to see lint, type errors, and more. The terminal will reveal individual tests to run again.
* If `black` alone is a problem, then run `black .` to automatically reformat your code.
* If `mypy` is a problem, then run `mypy .` to run `mypy` again.
5 changes: 3 additions & 2 deletions python/setup-python.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
python -m venv .venv
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
pip install -r requirements-dev.txt
pip install -r requirements-dev.txt
pip install --upgrade pip
Loading
Loading