-
Notifications
You must be signed in to change notification settings - Fork 25
#159 Code sanitisation (Updated) #240
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
Changes from all commits
b5d9e43
852e350
f9a72d0
9143a2c
560ceed
88dedfe
3921e57
2fa3a60
48edb0e
730e00a
79db946
01e95a6
cfe0068
0b20c6a
84bb3ed
825febb
b4a31da
d2f4139
9b3ccac
38e4da1
8138218
2ab0f0c
be943a6
2452ebe
33f4865
cf56585
bd4aced
2b82d79
34f1ad3
d62aa83
85d45a0
1e1cccf
da93f7f
01f4045
7828453
c7f11c4
a6acb0b
e85bfe1
2dd992c
2381e85
f822cca
0aeeb25
9aee692
5cc9259
54ce1d8
a8c6d1d
cf63851
373b44c
f03a6ed
722caca
73b2f8a
b8568e3
6adf2fc
dceb856
2bd7885
c62a333
a75124e
6104374
7c43d2a
49d12c9
80a57f0
81b2ec8
f3dca83
02cd0ad
97fbd56
0c5ff18
dc32db9
f62dfb4
fefca19
2706875
530037b
189dbad
cf6ded0
a23786d
01d2a85
d5eda1e
965a537
d5223c8
54d6016
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,11 +5,72 @@ description: Guide on how to contribute to this project | |||||||||||||||||||
| # How to contribute | ||||||||||||||||||||
|
|
||||||||||||||||||||
| First off, thanks for taking the time to contribute! | ||||||||||||||||||||
| We use GitHub as our main collaboration platform. Please work from the `development` branch, create small feature branches, and open focused pull requests. Follow Conventional Commit messages (e.g., `feat:`, `fix:`, `docs:`), format Python code with Black, and add tests where needed. Never merge your own PR—wait for review and address all comments (including AI reviewer suggestions). Use Issues and Projects to track tasks and discussions. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| > This project requires Python 3.11. Do not use Python 3.12 or newer, as it may cause dependency incompatibilities, build failure or runtime errors | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| ## General Feedback | ||||||||||||||||||||
|
|
||||||||||||||||||||
| If you have a general feedback about our project, please do not open an issue but instead please fill in this [form](https://forms.gle/LRUq3vsFnE1QCLiA6) | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ## Fork & branch processing | ||||||||||||||||||||
|
|
||||||||||||||||||||
| First fork the origin repository to your own github repository, then clone the repository to your local computer. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```bash | ||||||||||||||||||||
| git clone https://github.com/Your Account name/clima.git | ||||||||||||||||||||
| cd clima | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Set up the upstream repository and check the output repositories. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```bash | ||||||||||||||||||||
| git remote add upstream https://github.com/CenterForTheBuiltEnvironment/clima.git | ||||||||||||||||||||
|
|
||||||||||||||||||||
| git remote -v | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| The terminal should output a list: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - `origin → your Fork repository` | ||||||||||||||||||||
| - `upstream → origin repository` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Check all branches. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```bash | ||||||||||||||||||||
| git branch -a | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| The terminal will show a list of branches: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```bash | ||||||||||||||||||||
| > * main | ||||||||||||||||||||
| remotes/origin/HEAD -> origin/main | ||||||||||||||||||||
| remotes/origin/development | ||||||||||||||||||||
| remotes/origin/main | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Pull the development branch first, and if the terminal does not notice you that you should try the second command. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```bash | ||||||||||||||||||||
| git checktout development | ||||||||||||||||||||
|
|
||||||||||||||||||||
| git checkout -b development origin/development | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
Comment on lines
+54
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo in git command: checktout → checkout. This will block newcomers following the guide. Apply this diff: -git checktout development
+git checkout development📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||
| Create a new branch in the development branch. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```bash | ||||||||||||||||||||
| git checkout -b (your branch name) | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Finally update and push to your repository branch if you modify the files. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```bash | ||||||||||||||||||||
| git push origin (your branch name) | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ## Code of Conduct | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Available [here](code_of_conduct.md) | ||||||||||||||||||||
|
|
@@ -35,6 +96,57 @@ pipenv run pre-commit run --all-files | |||||||||||||||||||
| Hence, you will need to make sure that the code is formatted correctly before committing your changes; otherwise, the commit will fail. | ||||||||||||||||||||
| More information about pre-commit hooks can be found [here](https://pre-commit.com/). | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Install Black: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| We use ruff to enforce the code style and code formatting. You can run it with: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```bash | ||||||||||||||||||||
| pipenv run ruff check . | ||||||||||||||||||||
| pipenv run ruff format . | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| To ensure that the code is formatted correctly, we use a pre-commit hook that runs Ruff before every commit. | ||||||||||||||||||||
| Run the following once to enable hooks in your local repo: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```bash | ||||||||||||||||||||
| pipenv run pre-commit install | ||||||||||||||||||||
| # optional: run on all files | ||||||||||||||||||||
| pipenv run pre-commit run --all-files | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Hence, you will need to make sure that the code is formatted correctly before committing your changes; otherwise, the commit will fail. | ||||||||||||||||||||
| More information about pre-commit hooks can be found [here](https://pre-commit.com/). | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```bash | ||||||||||||||||||||
| pipenv install black | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Format your code before committing: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```bash | ||||||||||||||||||||
| black . | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ## Testing | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Before submitting a Pull Request, please make sure: | ||||||||||||||||||||
| - All tests should pass. | ||||||||||||||||||||
| - You have installed project dependencies: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```bash | ||||||||||||||||||||
| npm install | ||||||||||||||||||||
|
|
||||||||||||||||||||
| pipenv install -r requirements.txt | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| From the root directory, run: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ```bash | ||||||||||||||||||||
| cd tests/node | ||||||||||||||||||||
|
|
||||||||||||||||||||
| npx cypress run | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ## Submitting changes | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Please send a Pull Request with a clear list of what you've done. Always write a clear log message for your commits. One-line messages are fine for small changes, but bigger changes should look like this: | ||||||||||||||||||||
|
|
@@ -45,6 +157,43 @@ $ git commit -m "A brief summary of the commit | |||||||||||||||||||
| > A paragraph describing what changed and its impact." | ||||||||||||||||||||
| ``` | ||||||||||||||||||||
|
|
||||||||||||||||||||
| > Detailed requirements for submitting a PR are described in the [Pull Request Regulation](#pull-request-regulation) section below | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Classification of Common Commit Types: | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - `Main (Master)`: Stable branch, merge code that passes review and CI; merge and release every time, | ||||||||||||||||||||
| - `Develop`: Continuous Integration branch for daily integration with multiple collaborators. | ||||||||||||||||||||
| - `Feature/*`: feature development branch, cut out from main or develop, send PR to merge in after completing the feature. | ||||||||||||||||||||
| - `Fix/*`: defect repair branch, the same process as feature | ||||||||||||||||||||
| - `Release/*`: release preparation branch for freezing versions, fixing documentation, doing regressions and tagging. | ||||||||||||||||||||
| - `docs/*`, `chore/*`, `refactor/*`, `test/*`: documentation, miscellaneous, refactor, test type branches. | ||||||||||||||||||||
| - `Style`: style modification (does not affect the function): code formatting, space adjustment, naming rules unity. | ||||||||||||||||||||
| - `Refactor`: Code Refactoring: Refactor existing code to improve maintainability. | ||||||||||||||||||||
| - `Test`: Add or modify tests: add unit tests, integration tests, or modify test logic. | ||||||||||||||||||||
| - `Chore`: Build Configuration, Dependency Management, CI/CD Configuration Updates. | ||||||||||||||||||||
| - `Perf`: Performance Optimisation: Optimising code execution efficiency or memory usage. | ||||||||||||||||||||
| - `Ci`: CI Configuration Related: Changing Continuous Integration Configurations for Github Actions, Travis, Jenkins, etc. | ||||||||||||||||||||
| - `Build`: build system related: modify build scripts, packaging configuration. | ||||||||||||||||||||
| - `Revert`: Rollback Commit: Undoing a Previous Commit | ||||||||||||||||||||
| - `Security`: Security fixes, fixing security vulnerabilities, updating dependencies to prevent attacks. | ||||||||||||||||||||
| - `Deps`: Dependency Management: Dependency Management/Adding, updating, and removing dependency libraries | ||||||||||||||||||||
| - `Infra`: Infrastructure related: changes to development environments, containers, server configurations, etc. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| ## Pull Request Regulation | ||||||||||||||||||||
| **Time to submit PR:** | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - User requirements/issues have been addressed or discussed in Issue and consensus has been reached. | ||||||||||||||||||||
| - Changes have been minimised (small steps/phased submission) to avoid "mega PRs". | ||||||||||||||||||||
|
|
||||||||||||||||||||
| **The pull request should include the following information:** | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - **Description:** Provide a brief summary of the changes, related issues, and motivation. List any required dependencies. **Fixes # (issue)** | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - **Type of Change:** Bug fix (non-breaking); New feature (non-breaking); Breaking change; Documentation update. | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - **Testing:** Describe how you tested your changes and how we can reproduce them. Include test details if necessary. | ||||||||||||||||||||
|
|
||||||||||||||||||||
|
|
||||||||||||||||||||
| ## Thanks | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Thank you again for being interested in this project! You are awesome! | ||||||||||||||||||||
|
|
||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -13,4 +13,4 @@ $$ | |||||
|
|
||||||
|  | ||||||
|
|
||||||
|  | ||||||
|  | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use “Irradiance” instead of “Irradiation” in the image alt text Irradiance is the correct quantity for GHI/DHI/DNI; irradiation is time-integrated energy (different unit). Also simplified phrasing. Apply this diff: -
+📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,4 +12,4 @@ The base temperature does not necessarily correspond to the desired building int | |||||||||||||||
|
|
||||||||||||||||
| .png>) | ||||||||||||||||
|
|
||||||||||||||||
|  (1).png>) | ||||||||||||||||
|  (1).png>) | ||||||||||||||||
|
Comment on lines
13
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct alt-text spelling: “deegree” → “degree” (twice) These are visible to screen reader users; worth fixing. -.png>)
+.png>)
- (1).png>)
+ (1).png>)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix clone URL placeholder.
Space in “Your Account name” will break copy/paste.
Apply this diff:
📝 Committable suggestion
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
23-23: Dollar signs used before commands without showing output
(MD014, commands-show-output)
24-24: Dollar signs used before commands without showing output
(MD014, commands-show-output)
🤖 Prompt for AI Agents