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

These tests should NOT fail #151

Merged
merged 18 commits into from
Aug 14, 2024
Merged

These tests should NOT fail #151

merged 18 commits into from
Aug 14, 2024

Conversation

ilaflott
Copy link
Member

@ilaflott ilaflott commented Aug 9, 2024

Describe your changes

split up cli tests, add a new one based on the catalogbuilder interface, so we'll know if it changes again via a failed test.

Issue ticket number and link (if applicable)

#149

Checklist before requesting a review

  • I ran my code
  • I tried to make my code readable
  • I tried to comment my code
  • I wrote a new test, if applicable
    N/A - [x] I wrote new instructions/documentation, if applicable
  • I ran pytest and inspected it's output
  • I ran pylint and attempted to implement some of it's feedback

@ilaflott ilaflott requested a review from Ciheim August 12, 2024 13:36
@ilaflott ilaflott added enhancement New feature or request clean up labels Aug 12, 2024
@ilaflott
Copy link
Member Author

pylint score in current main branch is 3.34. These edits bring the code to about a 4.70. The aim is to address enough of the complaints that the score will easily fall if low quality code is committed in the future.

quick summary of changes:

  1. generally, lots of pylint cleanup.
  2. camel-case --> snake case changes,
  3. whitespace removal,
  4. long line breakups,
  5. add # pylint: disable=unused-argument, to ignore unused arguments in certain places for now
  6. asking pylint to ignore a fake-import-problem with netCDF4.Dataset
  7. add doc strings where easy to
  8. import order fixes
  9. add basic cli tests for all fre <tool> calls,
  10. add two extra cli tests for fre catalog builder calls to make sure we have something that might catch an API change on that front.

ilaflott and others added 8 commits August 12, 2024 12:21
more snake case enforcement.
variables appearing unused to pylint b.c. of click conventions ignored in more places
some unnecessary returns/passes/if-else conditions removed/rewritten
a doc string here and there
…nment and github's CI/CD

suspecting import problems with __init__.py file in fre/app/. everything works fine locally.

committing + pushing this while clobbering local folder/caches to start from a cleaner spot
used https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions as reference

also fix pylint warning about freyamltools.py and freyamltoolsexample.py in fre/yamltools
…bility

add some extra echo / which output to see if i understand the gh CICD env
@ilaflott
Copy link
Member Author

this PR now contains autogenerated documentation from python doc-strings!
https://github.com/NOAA-GFDL/fre-cli/actions/runs/10372226899/job/28714459606?pr=151

@ilaflott
Copy link
Member Author

ready to go

last tweak- couldnt look at the long-line admonishments anymore
print(f"Processed {var}")

return masked


def pressure_coordinate(ds, varname, verbose=False):
def pressure_coordinate(ds, varname):#, verbose=False):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verbose wasn't used, I see

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true! commented out... since it's not a BAD idea

import click
import catalogbuilder
#import catalogbuilder
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not! if it were, the new API tests in fre/catalog/tests would be failing

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't disagree with you. But it's weird still isn't it? should we remove the line then?

""" - Generate .csv and .json files for catalog """
context.forward(gen_intake_gfdl.main)
context.forward(gen_intake_gfdl.create_catalog_cli)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the update!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@ceblanton ceblanton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah! Lots of bonus good in this one, as well as the intended one line fix for the catalog builder api change.

@ilaflott ilaflott merged commit 220c9e7 into main Aug 14, 2024
3 checks passed
@ilaflott ilaflott deleted the this_test_should_fail branch August 14, 2024 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clean up enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants