Skip to content

Conversation

pmrv
Copy link
Contributor

@pmrv pmrv commented Feb 24, 2025

type(cls) is only equal to type if no other meta class has been used. This includes classes derived from ABC, so it is a bit inconvenient. Using the instance check however seems to work in these cases.

Copy link

Binder 👈 Launch a binder notebook on branch pyiron/pyiron_workflow/dataclass_typecheck

Copy link

codacy-production bot commented Feb 24, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.03% (target: -1.00%) 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (bd13cc3) 3422 3126 91.35%
Head commit (e79c196) 3432 (+10) 3136 (+10) 91.38% (+0.03%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#601) 1 1 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@coveralls
Copy link

coveralls commented Feb 24, 2025

Pull Request Test Coverage Report for Build 13540109426

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 6 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.03%) to 91.375%

Files with Coverage Reduction New Missed Lines %
mixin/run.py 6 94.17%
Totals Coverage Status
Change from base Build 13509927617: 0.03%
Covered Lines: 3136
Relevant Lines: 3432

💛 - Coveralls

pmrv added 2 commits February 24, 2025 10:24
type(cls) is only equal to type if no other meta class has been used.
This includes classes derived from ABC, so it is a bit inconvenient.
Using the instance check however seems to work in these cases.
@pmrv pmrv force-pushed the dataclass_typecheck branch from c6f96cd to 75e4dc6 Compare February 24, 2025 09:25
Copy link
Member

@liamhuber liamhuber left a comment

Choose a reason for hiding this comment

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

Yes, good catch. Now downsides are obvious to me, and the upside is clear. Once the CI passes, I'm happy.

@pmrv
Copy link
Contributor Author

pmrv commented Feb 26, 2025

Seems codacy is slow today. Based on its last known output I was gonna ignore it anyway as we discussed on zoom, so I'll go ahead an merge.

@pmrv pmrv merged commit 7c66e2d into main Feb 26, 2025
19 of 20 checks passed
@pmrv pmrv deleted the dataclass_typecheck branch February 26, 2025 09:37
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.

3 participants