Test helper errors on sunraster with dev version of ndcube

Open
#730 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
testing-qa

Research direction

Start by locating the assert_metas_equal test helper shown in the traceback and inspect how it compares metadata values. Update the comparison so array-valued keys do not produce an ambiguous truth-value error, then run the relevant sunraster tests to confirm the helper handles both scalar and array metadata.

Written by the indexing model from the issue text.

Description

Describe the bug
test_input = {'exposure time': <Quantity [2., 2.] s>}, expected_output = {'exposure time': <Quantity [2., 2.] s>}

    def assert_metas_equal(test_input, expected_output):
        if not (test_input is None and expected_output is None):
            assert test_input.keys() == expected_output.keys()
            for key in list(test_input.keys()):
>               assert test_input[key] == expected_output[key]
E               ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Need to account for a key being an array.

Dominant language
Python
Stars
49
Forks
56
Avg merge
5h 54m
Merged PRs (30d)
9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sunpy/ndcube

All issues in sunpy/ndcube

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.