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

Multiple small fixes to docstrings and typing #282

Merged
merged 25 commits into from
Nov 6, 2023
Merged

Conversation

RondeauG
Copy link
Collaborator

@RondeauG RondeauG commented Nov 1, 2023

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
    • No.
  • (If applicable) Documentation has been added / updated (for bug fixes / features).
  • (If applicable) Tests have been added.
  • This PR does not seem to break the templates.
  • HISTORY.rst has been updated (with summary of main changes).
    • Link to issue (:issue:number) and pull request (:pull:number) has been added.

What kind of change does this PR introduce?

  • Removed a few outdated imports.
  • Typing was added to multiple functions when it was missing.
  • Output types were added to multiple functions when it was missing.
  • Docstrings was added to multiple functions when it was missing.
  • Both str and os.PathLike should be explicitly supported where relevant.
  • Minor bugfixes when I saw them.
  • Module descriptions were added when missing.
  • To make things readable:
    • As much as possible, the type of data in lists was defined.
    • The type of data in dictionaries was not.

Does this PR introduce a breaking change?

  • It should not.

Other information:

  • Pycharm recommended that I add ABC to DataCatalog/ProjectCatalog. It this right? @aulemahal
  • The init and documentation of DataCatalog/ProjectCatalog should be reworked to be easier to understand, but this is out-of-scope for this PR. For example we use *args, but AFAIK there is only one possible input argument, obj.

xscen/biasadjust.py Outdated Show resolved Hide resolved
xscen/catalog.py Outdated Show resolved Hide resolved
xscen/catutils.py Outdated Show resolved Hide resolved
xscen/regrid.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Zeitsperre Zeitsperre left a comment

Choose a reason for hiding this comment

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

Good changes overall. I think the Optional usage needs to be clarified here. Will be good to go afterwards!

EDIT: To reiterate, the Optional serves both the IDE/user and helps with the static type checking that would come from mypy. We don't currently have any projects that are 100% mypy-compliant, but the more we implement now, the easier it will be in the future.

Why use mypy? https://python.plainenglish.io/mypy-your-secret-weapon-for-code-brilliance-a376d15c463c

xscen/aggregate.py Outdated Show resolved Hide resolved
xscen/aggregate.py Show resolved Hide resolved
xscen/biasadjust.py Outdated Show resolved Hide resolved
xscen/catalog.py Outdated Show resolved Hide resolved
xscen/catalog.py Outdated Show resolved Hide resolved
xscen/catalog.py Outdated Show resolved Hide resolved
xscen/catalog.py Outdated Show resolved Hide resolved
xscen/catalog.py Outdated Show resolved Hide resolved
xscen/catalog.py Outdated Show resolved Hide resolved
xscen/catutils.py Outdated Show resolved Hide resolved
RondeauG and others added 2 commits November 3, 2023 09:26
Co-authored-by: juliettelavoie <[email protected]>
Co-authored-by: juliettelavoie <[email protected]>
xscen/catalog.py Outdated Show resolved Hide resolved
xscen/catalog.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Zeitsperre Zeitsperre left a comment

Choose a reason for hiding this comment

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

Lots of work here. looking good!

xscen/aggregate.py Show resolved Hide resolved
xscen/catutils.py Outdated Show resolved Hide resolved
xscen/utils.py Outdated Show resolved Hide resolved
@RondeauG RondeauG merged commit 2d895b2 into main Nov 6, 2023
9 checks passed
@RondeauG RondeauG deleted the small_cleanups branch November 6, 2023 21:59
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.

4 participants