You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will allow us to more easily set fields for all Artifacts initiated within the block, including those generated by Producers. Ex:
with Graph(...) as g:
with Artifact.defaults(annotations=[...], format=..., storage=...): # maybe better name than "default"
g.artifacts.a = A(...)
g.artifacts.b = compute(a=a)
We can likely use the arti.context to track stacks for each field (allowing nesting contexts). On Artifact initialization (or rather, in a pydantic @validator("...", always=True)s), we'll pull from the stack:
annotations should concatenate the arti.context annotation stack with those passed explicitly
format and storage should default to the last item in their respective arti.context stack, if not set explicitly
--
Something similar for Statistics and Thresholds would be interesting, but may be a bit trickier (eg: a Statistic may not work for all types, etc).
The text was updated successfully, but these errors were encountered:
JacobHayes
changed the title
Add Annotations setting context manager
Add Artifact.{annotations,format,storage} setting context manager(s)
Jan 7, 2022
This will allow us to more easily set fields for all Artifacts initiated within the block, including those generated by Producers. Ex:
We can likely use the
arti.context
to track stacks for each field (allowing nesting contexts). On Artifact initialization (or rather, in a pydantic@validator("...", always=True)
s), we'll pull from the stack:annotations
should concatenate thearti.context
annotation stack with those passed explicitlyformat
andstorage
should default to the last item in their respectivearti.context
stack, if not set explicitly--
Something similar for Statistics and Thresholds would be interesting, but may be a bit trickier (eg: a Statistic may not work for all types, etc).
The text was updated successfully, but these errors were encountered: