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

support types in the typing module #37

Merged
merged 5 commits into from
Oct 24, 2023

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Oct 23, 2023

This will be very useful for all downstream projects to set types like list[str], list[list[str]], etc.

>>> ca = Argument("key1", List[float])
>>> ca.check({"key1": [1, 2.0, 3]})
pass
>>> ca.check({"key1": [1, 2.0, "3"]})
throw ArgumentTypeError

njzjz and others added 2 commits October 23, 2023 01:00
>>> ca = Argument("key1", List[float])
>>> ca.check({"key1": [1, 2.0, 3]})
pass
>>> ca.check({"key1": [1, 2.0, "3"]})
throw ArgumentTypeError

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

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

Comparison is base (aef1574) 80.29% compared to head (e2b0f8e) 80.53%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #37      +/-   ##
==========================================
+ Coverage   80.29%   80.53%   +0.24%     
==========================================
  Files           3        3              
  Lines         482      488       +6     
==========================================
+ Hits          387      393       +6     
  Misses         95       95              
Files Coverage Δ
dargs/sphinx.py 0.00% <ø> (ø)
dargs/dargs.py 95.36% <92.30%> (+0.06%) ⬆️

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

njzjz added a commit to njzjz/dflow that referenced this pull request Oct 23, 2023
I am implementing a new feature into dargs in deepmodeling/dargs#37, which requires typeguard>=3, and I hope there is no compatibility issues.

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@njzjz njzjz changed the title support types in typing module support types in the typing module Oct 23, 2023
njzjz and others added 2 commits October 23, 2023 01:41
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@y1xiaoc
Copy link
Collaborator

y1xiaoc commented Oct 23, 2023

LGTM

@njzjz njzjz merged commit d97bd20 into deepmodeling:master Oct 24, 2023
@njzjz njzjz deleted the check-typing-types branch October 24, 2023 03:39
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