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

docs: add typing to commons #1054

Merged
merged 11 commits into from
Oct 18, 2021
Merged

docs: add typing to commons #1054

merged 11 commits into from
Oct 18, 2021

Conversation

bonjourmauko
Copy link
Member

@bonjourmauko bonjourmauko commented Sep 29, 2021

Fixes #1230
Follows discussion on #1033

New Features

  • Introduce openfisca_core.types

Documentation

  • Complete typing of the commons module

@bonjourmauko bonjourmauko added kind:refactor Refactoring and code cleanup kind:theme A group of issues, directly tied to an OKR kind:roadmap A group of issues, constituting a delivery roadmap labels Sep 29, 2021
@bonjourmauko bonjourmauko requested review from MattiSG and a team September 29, 2021 14:00
openfisca_core/commons/formulas.py Outdated Show resolved Hide resolved
openfisca_core/commons/rates.py Outdated Show resolved Hide resolved
@bonjourmauko bonjourmauko force-pushed the typing/commons branch 4 times, most recently from 595ed67 to b3e5289 Compare October 7, 2021 09:43
setup.py Show resolved Hide resolved
@bonjourmauko bonjourmauko mentioned this pull request Oct 7, 2021
17 tasks
@bonjourmauko bonjourmauko removed kind:theme A group of issues, directly tied to an OKR kind:roadmap A group of issues, constituting a delivery roadmap labels Oct 7, 2021
@bonjourmauko bonjourmauko changed the title [1/*] Improve commons module typing [1/17] Improve commons module typing Oct 7, 2021
MattiSG
MattiSG previously approved these changes Oct 7, 2021
Copy link
Member

@MattiSG MattiSG left a comment

Choose a reason for hiding this comment

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

After a video discussion with @maukoquiroga and a bit of research (see also #1033 (comment)), I understand that adding type hints:

  • Will have no functional impact on OpenFisca.
  • Will not force contributors to add their own type hints.
  • Will not force country packages to add their own type hints.
  • Will improve generated documentation.
  • Will improve readability of the code base.
  • Will improve testability of the code base.
  • Opens up the way for future optimisations: if the whole codebase gets type-annotated, it will be easier to compile, to statically analyse, and to optimise for performance.

In order to minimise install performance side-effects and burden, I requested that additional dependencies are kept to a minimum, which has been done today.

Under these conditions, I believe this changeset adds value and does not warrant a preliminary community agreement, as it should be considered mainly as documentation improvement.
I suggest type hints to be encouraged in future PRs, but not required. Once production and contribution feedback has been obtained, we should consider opening an RFC on making type hints mandatory for future contributions along with strict CI checks.

.gitignore Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
setup.py Show resolved Hide resolved
openfisca_core/types/__init__.py Outdated Show resolved Hide resolved
openfisca_core/types/__init__.py Show resolved Hide resolved
openfisca_core/commons/rates.py Show resolved Hide resolved
@MattiSG
Copy link
Member

MattiSG commented Oct 7, 2021

I see that my approving review has been dismissed. Please let me know if there is anything I can do in that regard @maukoquiroga 🙂

@bonjourmauko
Copy link
Member Author

@MattiSG As soon as circleci passes, this should be LGTM :)

Copy link
Member

@MattiSG MattiSG left a comment

Choose a reason for hiding this comment

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

New changes reviewed & approved 😉

My previous review was auto-dismissed (cf. #990 (comment)).

@bonjourmauko
Copy link
Member Author

This stills needs your review @benjello 😃

@benjello benjello merged commit da995e4 into master Oct 18, 2021
@benjello benjello deleted the typing/commons branch October 18, 2021 10:36
@benjello benjello restored the typing/commons branch October 18, 2021 10:36
@bonjourmauko bonjourmauko deleted the typing/commons branch October 18, 2021 12:49
@bonjourmauko
Copy link
Member Author

There was a weird issue in circleci regarding the version check, however I cannot understand the cause. All looks good to me.

@bonjourmauko
Copy link
Member Author

Thanks @benjello !

@bonjourmauko bonjourmauko changed the title [1/17] Improve commons module typing docs: add typing to commons Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:refactor Refactoring and code cleanup
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add typing to commons
3 participants