-
Notifications
You must be signed in to change notification settings - Fork 0
Fix ruff #39
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
Open
daklauss
wants to merge
13
commits into
master
Choose a base branch
from
fix-ruff
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix ruff #39
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
da1cd32
Fix cipipeline so ruff only works once
daklauss e9d5f8d
Add preview=true option
daklauss d61c130
Add ruff github action+fix
daklauss 7fce1d7
Add pre-commit-config.yaml
daklauss 0365951
Ignore rule D203 to fix warning of inconsistent rules
daklauss daeb057
Fix Formating....
daklauss 957b91e
Rmv ruff format
daklauss 5a3db4a
Fix test format
daklauss 13d1b31
Add tests to ruff
daklauss 8eb3e12
Ruff on push only on dev/master
daklauss ce0d0d7
Rmv ignoring rule F401 for unused imports
daklauss f542530
Add dev optional dependency
daklauss 235d1ec
Restructure optional dependencies into dependency-groups
daklauss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
name: Ruff | ||
on: [ push, pull_request ] | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- dev | ||
pull_request: | ||
jobs: | ||
ruff: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Python | ||
uses: actions/setup-python@v5 | ||
- uses: astral-sh/ruff-action@v3 | ||
with: | ||
python-version: "3.11" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install ruff | ||
- name: Run Ruff | ||
run: ruff check --output-format=github . | ||
args: check --output-format=github |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.11.7 | ||
hooks: | ||
# Run the linter. | ||
- id: ruff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
"""Version information.""" | ||
|
||
name = "CADET-Python-Simulator" | ||
__version__ = "0.0.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import abc | ||
import numpy as np | ||
from CADETPythonSimulator.unit_operation import UnitOperationBase | ||
|
||
|
||
class CouplingInterface(abc.ABC): | ||
|
@@ -10,18 +9,19 @@ class CouplingInterface(abc.ABC): | |
def get_coupled_state( | ||
self, | ||
origin_list: list[(dict, float)], | ||
state: str | ||
) -> np.ndarray: | ||
state: str, | ||
) -> np.ndarray: | ||
"""Calculate new state for destination_unit.""" | ||
|
||
|
||
class WeightedAverageCoupling(CouplingInterface): | ||
"""Implements the Coupling Interface for average Coupling.""" | ||
|
||
def get_coupled_state(self, | ||
origin_list: list[(dict, float)], | ||
state: str | ||
) -> np.ndarray: | ||
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. Add trailing comma to avoid line break. (See https://docs.astral.sh/ruff/settings/#format_skip-magic-trailing-comma) |
||
def get_coupled_state( | ||
self, | ||
origin_list: list[(dict, float)], | ||
state: str, | ||
) -> np.ndarray: | ||
"""Calculate new state for destination_unit with average Coupling.""" | ||
ret = np.zeros(origin_list[0][0][state].shape) | ||
rate_tot = 0 | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Add trailing comma to avoid line break. (See https://docs.astral.sh/ruff/settings/#format_skip-magic-trailing-comma).