Skip to content

Commit

Permalink
improved citations
Browse files Browse the repository at this point in the history
  • Loading branch information
flexatone committed May 23, 2024
1 parent fd250fe commit da0a4e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion papers/christopher_ariza/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ x = process3(v3, q) # error
# └── Expected signedinteger, provided float64 invalid
```

StaticFrame provides utilities to extend runtime validation beyond type checking. Using the ``typing`` module's ``Annotated`` class, we can extend the type specification with one or more StaticFrame ``Require`` objects. For example, to validate that an array has a 1D shape of `(24,)`, we can replace ``TNDArrayIntAny`` with ``Annotated[TNDArrayIntAny, sf.Require.Shape(24)]``. To validate that a float array has no NaNs, we can replace ``TNDArrayFloat64`` with ``Annotated[TNDArrayFloat64, sf.Require.Apply(lambda a: ~a.insna().any())]``
StaticFrame provides utilities to extend runtime validation beyond type checking. Using the ``typing`` module's ``Annotated`` class [@pep593], we can extend the type specification with one or more StaticFrame ``Require`` objects. For example, to validate that an array has a 1D shape of `(24,)`, we can replace ``TNDArrayIntAny`` with ``Annotated[TNDArrayIntAny, sf.Require.Shape(24)]``. To validate that a float array has no NaNs, we can replace ``TNDArrayFloat64`` with ``Annotated[TNDArrayFloat64, sf.Require.Apply(lambda a: ~a.insna().any())]``

Implementing a new function, we can require that all input and output arrays have the shape `(24,)`. Calling this function with the previously created arrays raises an error:

Expand Down
6 changes: 3 additions & 3 deletions papers/christopher_ariza/mybib.bib
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ @article{numpy
}

@techreport{pep646,
author = {Mark Mendoza, Matthew Rahtz, Pradeep Kumar Srinivasan, Vincent Siles},
author = {Mendoza, Mark and Rahtz, Matthew and Srinivasan, Pradeep Kumar and Siles, Vincent},
title = {PEP 646 - Variadic Generics},
year = {2020},
type = {PEP},
Expand All @@ -75,7 +75,7 @@ @techreport{pep646
}

@techreport{pep484,
author = {Guido van Rossum, Jukka Lehtosalo, Łukasz Langa},
author = {van Rossum, Guido and Lehtosalo, Jukka and Langa, Łukasz},
title = {PEP 484 - Type Hints},
year = {2014},
type = {PEP},
Expand All @@ -84,7 +84,7 @@ @techreport{pep484
}

@techreport{pep593,
author = {Ryan Gonzalez, Philip House, Ivan Levkivskyi, Lisa Roach, Guido van Rossum},
author = {Gonzalez, Ryan and House, Philip and Levkivskyi, Ivan and Roach, Lisa and van Rossum, Guido},
title = {PEP 593 - Flexible Function and Variable Annotations},
year = {2019},
type = {PEP},
Expand Down

0 comments on commit da0a4e6

Please sign in to comment.