pyiron / uniton

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Add typing #3

Closed samwaseda closed 1 month ago

samwaseda commented 1 month ago

Originally planned here but I decided to make it internally a bit less complicated.

@units
def get_speed_onto(
    distance: u(float, "meter"), time: u(float, "second")
) -> u(float, "meter/second"):
    return distance / time

The functionality is the same as shown in the previous PRs. What happens internally is:

print(u(float, "meter/second"))

Output: typing.Annotated[float, 'meter/second', None]

And it's up to the parser to figure out what to do with the additional information. The last item in the list is meant to be used for the ontology type

github-actions[bot] commented 1 month ago

Binder :point_left: Launch a binder notebook on branch _pyiron/uniton/addtyping

codacy-production[bot] commented 1 month ago

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
:x: -3.39% (target: -1.00%) :white_check_mark: 96.49%
Coverage variation details | | Coverable lines | Covered lines | Coverage | | ------------- | ------------- | ------------- | ------------- | | Common ancestor commit (4da8c9b165d6fc84ab31ea2db43c103d8a3f26e2) | 2 | 2 | 100.00% | | | Head commit (1311567beb586ea1e0336b09109cae3730dacb17) | 59 (+57) | 57 (+55) | 96.61% (**-3.39%**) | **Coverage variation** is the difference between the coverage for the head and common ancestor commits of the pull request branch: ` - `
Diff coverage details | | Coverable lines | Covered lines | Diff coverage | | ------------- | ------------- | ------------- | ------------- | | Pull request (#3) | 57 | 55 | **96.49%** | **Diff coverage** is the percentage of lines that are covered by tests out of the coverable lines that the pull request 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 commented 1 month ago

Pull Request Test Coverage Report for Build 10910347824

Details


Totals Coverage Status
Change from base Build 10903278866: -3.4%
Covered Lines: 57
Relevant Lines: 59

💛 - Coveralls
samwaseda commented 1 month ago

@liamhuber Sorry I merged it too fast...