Skip to content

Conversation

@FBumann
Copy link
Member

@FBumann FBumann commented Jan 20, 2025

Linting and formating

Using ruff, the whole codebase was linted and formatted running ruff check . and ruff format
Linting was also added to CI-CD. This ensures code quality throughout the project.

Following the Linting rules is easy by running ruff check . --fix before every push.

The rules of listing and formatting are specified in pyproject.toml. ruff was added to the dev-dependencies

* Remove not needed function

* Add comment to docstring

* Add parameter use_element_label tp have shorter representation without duplication of information

* Add use_element_label = False to all data conversion before saving to JSON
…-path handling is not working.

No caching as time savings are minimal (<10sec, if cache is found, while 2min for inital caching)
Using ruff format on the whole codebase
This reverts commit a3a12d6.
…ixOpt" and Parameters with NOT lowercase names in linear_converters.py ( ".COP", ".Q_th", ...)
…+linting

# Conflicts:
#	examples/02_Complex/complex_example.py
#	flixOpt/calculation.py
#	flixOpt/features.py
#	flixOpt/flow_system.py
#	flixOpt/structure.py
#	tests/test_integration.py
@FBumann FBumann changed the base branch from next/minor to next/patch January 22, 2025 15:08
@FBumann FBumann merged commit 0ccfbcb into next/patch Jan 22, 2025
4 checks passed
@FBumann FBumann linked an issue Jan 22, 2025 that may be closed by this pull request
FBumann added a commit that referenced this pull request Jan 22, 2025
* Feature/simplify datastructure (#136)

* Remove not needed function

* Add comment to docstring

* Add parameter use_element_label tp have shorter representation without duplication of information

* Add use_element_label = False to all data conversion before saving to JSON

* Add ci-cd to run test automatically. Currently exclude pyvis, as file-path handling is not working.
No caching as time savings are minimal (<10sec, if cache is found, while 2min for inital caching)

* Add functional tests

* Adding InvestmentTests

* Adding TestOnOff

* Changing some names

* Adding on count

* Update to new function

* Add docstrings to tests

* adding pytest and adding if __name__ == '__main__':

* Remove change in minimal_example.py (empty line)

* Improving test to use new dict based datastructure

* Some refinements

* Add test for consecutive hours

* Running ruff check --fix

* Running `ruff check . --fix` with options defined in pyproject.toml

* Adopt fx. approach in tests

* Bugfix ruff config

* Fix some ruff errors

* Fix some ruff errors

* Removing outdated function (fund with ruff)

* Finalizing linting issues

* fixing lint error

* Add linting to CI-CD
Using ruff format on the whole codebase

* Lint BEFORE test

* Revert "Lint BEFORE test"

This reverts commit a3a12d6.

* Revert "Add linting to CI-CD"

This reverts commit e8937b7.

* Lint before test and add formating settings

* format the whole codebase

* Enforcing naming conventions (except: "flixOpt as fx" module name "flixOpt" and Parameters with NOT lowercase names in linear_converters.py ( ".COP", ".Q_th", ...)

* Correct comment

* formating

* Adjusting test
@FBumann FBumann deleted the feature/testing+linting branch February 27, 2025 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mehr Tests

2 participants