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

Find suitable new location for format_tag #1404

Closed
braingram opened this issue Feb 20, 2023 · 2 comments · Fixed by #1433
Closed

Find suitable new location for format_tag #1404

braingram opened this issue Feb 20, 2023 · 2 comments · Fixed by #1433
Milestone

Comments

@braingram
Copy link
Contributor

This is currently in the soon the be deprecated asdf.types:

asdf/asdf/types.py

Lines 17 to 29 in f726fe8

def format_tag(organization, standard, version, tag_name):
"""
Format a YAML tag.
"""
tag = f"tag:{organization}:{standard}/{tag_name}"
if version is None:
return tag
if isinstance(version, AsdfSpec):
version = str(version.spec)
return f"{tag}-{version}"

It does not depend on the legacy type system and could be moved to a new location.

I've only found 1 use of this in test_schema.py:

tag = types.format_tag("stsci.edu", "asdf", "1.0.0", "fits/fits")

@braingram braingram added this to the 2.15 milestone Feb 20, 2023
@WilliamJamieson
Copy link
Contributor

I would say either put it in testing.helpers, asdf.schema, or asdf.util.

@WilliamJamieson
Copy link
Contributor

My personal preference is for the helpers as it seems to be only used for testing.

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 a pull request may close this issue.

2 participants