-
Notifications
You must be signed in to change notification settings - Fork 2
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
More linting. Ignore ESP file. Clean redundancy in CI. #78
Conversation
@@ -30,7 +30,7 @@ jobs: | |||
pip install pylint | |||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |||
- name: Lint with PyLint | |||
run: pylint --ignore="demo" --recursive=y --fail-under=9 ./* | |||
run: pylint ./* |
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.
We don't need these flags because they're specified in pylintrc now
|
||
recursive=y | ||
|
||
fail-under=9.0 |
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.
Moved flags from eluc.yml into here. Now we ignore the esp directory because it can't be installed in the Github environment
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.
Your code has been rated at 9.38/10
Next, we should raise the bar to 10 and fix the warnings.
good-names=X_train, X_val, X_test, y_train, y_val, y_test, X, Y, y, X_test_scaled, df, da, ds, i, n |
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.
Added some common "ok" names that break pylint convention
@@ -23,7 +23,7 @@ BLUE simulations with committed emissions could be used to estimate the long-ter | |||
"Committed emissions" means all the emissions that are caused by a land-use change event are attributed to the year | |||
of the event. | |||
BLUE (bookkeeping of land use emissions) is a bookkeeping model that attributes carbon fluxes to land use activities. | |||
See [BLUE: Bookkeeping of land use emissions](https://doi.org/10.1002/2014GB004997) for more details. | |||
See [BLUE: Bookkeeping of Land Use Emissions](https://doi.org/10.1002/2014GB004997) for more details. |
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.
Tried and failed to fix a weird error: README.md:26:74: E0001: Parsing failed: 'invalid decimal literal (, line 26)' (syntax-error)
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.
Not sure why pylint evaluating README.md. We can probably ignore these files with:
ignore-patterns=*.md
That can investigate when we fix the warnings
@@ -64,7 +64,7 @@ def calculate_crowding_distance(front): | |||
n_objectives = len(front[0].metrics) | |||
distances = [0 for _ in range(len(front))] | |||
for m in range(n_objectives): | |||
front.sort(key=lambda c: c.metrics[m]) | |||
front.sort(key=lambda cand: cand.metrics[m]) |
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.
Changed all of these to make it more clear c is a candidate
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.
you could go as far as calling cand
candidate
. That will more more readable and we can afford the extra letters
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.
lgtm
|
||
recursive=y | ||
|
||
fail-under=9.0 |
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.
Your code has been rated at 9.38/10
Next, we should raise the bar to 10 and fix the warnings.
@@ -23,7 +23,7 @@ BLUE simulations with committed emissions could be used to estimate the long-ter | |||
"Committed emissions" means all the emissions that are caused by a land-use change event are attributed to the year | |||
of the event. | |||
BLUE (bookkeeping of land use emissions) is a bookkeeping model that attributes carbon fluxes to land use activities. | |||
See [BLUE: Bookkeeping of land use emissions](https://doi.org/10.1002/2014GB004997) for more details. | |||
See [BLUE: Bookkeeping of Land Use Emissions](https://doi.org/10.1002/2014GB004997) for more details. |
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.
Not sure why pylint evaluating README.md. We can probably ignore these files with:
ignore-patterns=*.md
That can investigate when we fix the warnings
@@ -64,7 +64,7 @@ def calculate_crowding_distance(front): | |||
n_objectives = len(front[0].metrics) | |||
distances = [0 for _ in range(len(front))] | |||
for m in range(n_objectives): | |||
front.sort(key=lambda c: c.metrics[m]) | |||
front.sort(key=lambda cand: cand.metrics[m]) |
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.
you could go as far as calling cand
candidate
. That will more more readable and we can afford the extra letters
@@ -64,7 +64,7 @@ def calculate_crowding_distance(front): | |||
n_objectives = len(front[0].metrics) | |||
distances = [0 for _ in range(len(front))] | |||
for m in range(n_objectives): | |||
front.sort(key=lambda c: c.metrics[m]) | |||
front.sort(key=lambda candidate: candidate.metrics[m]) |
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.
c to candidate
@@ -43,7 +43,7 @@ def __init__(self, in_size: int, hidden_size: int, out_size: int, | |||
self.parents = parents | |||
|
|||
@classmethod | |||
def from_crossover(cls, parent1, parent2, p_mutation: float, gen: int, cand_id: int): | |||
def from_crossover(cls, parent1, parent2, p_mutation: float, gen: int, cand_id: int) -> "Candidate": |
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.
class method returns itself
Simple linting PR to ensure we pass the linting check in the CI. Was passing locally before because I have ESP installed but the CI can't install it.