Skip to content

chore: change raise NotImplementedError to raise TypeError#605

Merged
floriankrb merged 3 commits intoecmwf:mainfrom
jfdev001:jfrazier/602-change-raise-not-implemented-to-pass
Apr 14, 2026
Merged

chore: change raise NotImplementedError to raise TypeError#605
floriankrb merged 3 commits intoecmwf:mainfrom
jfdev001:jfrazier/602-change-raise-not-implemented-to-pass

Conversation

@jfdev001
Copy link
Copy Markdown
Contributor

@jfdev001 jfdev001 commented Apr 8, 2026

Description

Per python docs: built-in execptions#TypeError, TypeError should be used to indicate an operation is not supported. This PR replaces the NotImplementedError, which would imply one should implement the method, to TypeError to more clearly indicate the method is not meant to be implemented at all for children of the read-only class.

What issue or task does this change relate to?

#602

As a contributor to the Anemoi framework, please ensure that your changes include unit tests, updates to any affected dependencies and documentation, and have been tested in a parallel setting (i.e., with multiple GPUs). As a reviewer, you are also responsible for verifying these aspects and requesting changes if they are not adequately addressed. For guidelines about those please refer to https://anemoi.readthedocs.io/en/latest/

By opening this pull request, I affirm that all authors agree to the Contributor License Agreement.

@github-project-automation github-project-automation Bot moved this to To be triaged in Anemoi-dev Apr 8, 2026
@jfdev001 jfdev001 marked this pull request as draft April 8, 2026 12:28
@jfdev001 jfdev001 marked this pull request as ready for review April 8, 2026 12:39
Comment thread src/anemoi/datasets/compat/zarr2.py
@jfdev001 jfdev001 force-pushed the jfrazier/602-change-raise-not-implemented-to-pass branch from 33e1f2a to 2ad54e3 Compare April 14, 2026 10:57
@jfdev001 jfdev001 changed the title chore: change raise exception in child of ABC to pass chore: change raise NotImplementedError to raise TypeError Apr 14, 2026
@jfdev001
Copy link
Copy Markdown
Contributor Author

jfdev001 commented Apr 14, 2026

@floriankrb The CI failure due to

https://github.com/ecmwf/anemoi-datasets/actions/runs/24395197665/job/71260494246?pr=605#step:6:5416

showed up also in another PR i made (see #597 (comment)). I provided what i believe is a fix in that other PR here:

5a79d28

@floriankrb floriankrb merged commit c1491f3 into ecmwf:main Apr 14, 2026
13 of 22 checks passed
@github-project-automation github-project-automation Bot moved this from To be triaged to Done in Anemoi-dev Apr 14, 2026
@floriankrb
Copy link
Copy Markdown
Member

The failure is not related, so I merged your PR.

And yes, you fix is also relevant, I implemented it there: #609

@jfdev001 jfdev001 deleted the jfrazier/602-change-raise-not-implemented-to-pass branch April 14, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants