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
In order to automatically generate static Python code based on schemas (for Roman) I ideally would like the ability to directly access the path to a schema using its URI. Currently, most access patterns result in the loaded bytes object containing the file's data rather than just the file path. Note that it is possible for me to work with the bytes, but it requires a lot of hacks deep into the code generator. Instead, if I provide a function that returns a file path given a URI then the generator can simply use its own read and parse functionality to read the schema.
Note that, I can do this for the Rad schemas to get say the aperture-1.0.0 schema using:
This makes use of several private ASDF APIs. The reason I cannot use the public API is that the DirectoryResourceMapping.__getitem__ object used to register the Rad schemas with ASDF calls .read_bytes() on the path objects in the _uri_to_file dictionary.
Something like a .get_file_path_for_uri(uri) method on the resource manager would be idea for what I need. I may also require a .has_file_path_for_uri(uri) as well.
The text was updated successfully, but these errors were encountered:
In order to automatically generate static Python code based on schemas (for Roman) I ideally would like the ability to directly access the path to a schema using its URI. Currently, most access patterns result in the loaded bytes object containing the file's data rather than just the file path. Note that it is possible for me to work with the bytes, but it requires a lot of hacks deep into the code generator. Instead, if I provide a function that returns a file path given a URI then the generator can simply use its own read and parse functionality to read the schema.
Note that, I can do this for the Rad schemas to get say the
aperture-1.0.0
schema using:This makes use of several private ASDF APIs. The reason I cannot use the public API is that the
DirectoryResourceMapping.__getitem__
object used to register the Rad schemas with ASDF calls.read_bytes()
on the path objects in the_uri_to_file
dictionary.Something like a
.get_file_path_for_uri(uri)
method on the resource manager would be idea for what I need. I may also require a.has_file_path_for_uri(uri)
as well.The text was updated successfully, but these errors were encountered: