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

rmv unnecessary default_factories #1905

Merged
merged 11 commits into from
Feb 12, 2024

Conversation

bendichter
Copy link
Contributor

As far as I can tell, the pattern field(default_factory=lambda: X) makes sense if you have a mutable field, a field that requires substantial computation, or a field where the assignment needs to be delayed until after the definition of the class. In the case where X is simply a bool, an int, or a string, I don't think this does anything for you and can safely be removed. Is there a reason to have this that I am missing?

tests/output/annotations.context.jsonld Outdated Show resolved Hide resolved
tests/output/extensions.context.jsonld Outdated Show resolved Hide resolved
tests/output/mappings.context.jsonld Outdated Show resolved Hide resolved
tests/output/meta.context.jsonld Outdated Show resolved Hide resolved
tests/output/types.context.jsonld Outdated Show resolved Hide resolved
Copy link

codecov bot commented Feb 12, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (7140555) 80.05% compared to head (0735a74) 80.05%.

Files Patch % Lines
linkml/generators/summarygen.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1905   +/-   ##
=======================================
  Coverage   80.05%   80.05%           
=======================================
  Files         100      100           
  Lines       11500    11500           
  Branches     2968     2902   -66     
=======================================
  Hits         9206     9206           
  Misses       1738     1738           
  Partials      556      556           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@cmungall cmungall left a comment

Choose a reason for hiding this comment

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

Much cleaner, thanks.

Btw, looks like you accidentally committed 2 /output/ files. These are annoying vestige we need to get rid of. Mostly it's harmless to commit these changes but it could lead to spurious conflicts. See https://linkml.io/linkml/contributing/contributing.html#general-tips

@cmungall cmungall merged commit d4beb39 into linkml:main Feb 12, 2024
10 checks passed
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.

None yet

2 participants