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

Comparisons for FormatAgent() #6108

Closed
mo-tgeddes opened this issue Aug 8, 2024 · 1 comment · Fixed by #6119
Closed

Comparisons for FormatAgent() #6108

mo-tgeddes opened this issue Aug 8, 2024 · 1 comment · Fixed by #6119
Assignees
Labels
Good First Issue A good issue to take on if you're just getting started with Iris development

Comments

@mo-tgeddes
Copy link

✨ Feature Request

Allow objects of type FormatAgent to be compared to each other to see if they are equal. For example:

>>>import iris.fileformats
>>>from copy import deepcopy
>>>agent_copy = deepcopy(iris.fileformats.FORMAT_AGENT)
>>>agent_copy == iris.fileformats.FORMAT_AGENT
True

Currently the result would be false.

Motivation

It would be useful for testing purposes.

Additional context

Use Case ANTS uses iris.load and modifies iris.fileformats.FORMAT_AGENT to modify some FormatSpecifications and add a few more. We want it to do this within a context manager so that iris behaviour is not modified by importing ants. To test this we need to test that once outside of the context manager, the FORMAT_AGENT is the same as it was before the context manager was called. This requires comparing the FORMAT_AGENT to a copy of itself.
@trexfeathers trexfeathers added the Good First Issue A good issue to take on if you're just getting started with Iris development label Aug 8, 2024
@trexfeathers
Copy link
Contributor

@jrackham-mo tells us that the MIAO team (ANTS developers) would be interested in writing this so I have assigned @mo-tgeddes in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue A good issue to take on if you're just getting started with Iris development
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants