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

import GPUNotAvailableError to error.py #1694

Merged
merged 6 commits into from Jan 12, 2024

Conversation

melodyyzh
Copy link
Contributor

@melodyyzh melodyyzh commented Jan 10, 2024

Description

Imported GPUNotAvailableError in error.py.

Will remove util.GPNotavailableError in a branch off trunk-major after this branch is merged

Motivation and context

util should hold utility methods and error should hold error classes.

Resolves #1649

How has this been tested?

Change log

Added

* ``hoomd.error.GPUNotAvailableError``
  (`#1694 <https://github.com/glotzerlab/hoomd-blue/pull/1694>`__).

Deprecated:

* ``hoomd.util.GPUNotAvailableError``
  (`#1694 <https://github.com/glotzerlab/hoomd-blue/pull/1694>`__).

Checklist:

@melodyyzh melodyyzh requested review from a team as code owners January 10, 2024 14:26
@melodyyzh melodyyzh requested review from tcmoore3, tommy-waltmann and Tobias-Dwyer and removed request for a team January 10, 2024 14:26
Copy link
Contributor

@tommy-waltmann tommy-waltmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the referenced issue (#1649), it states that this PR should also "Note in the documentation that util.GPUNotAvailableError is deprecated and will move to error."

Copy link
Member

@joaander joaander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To complete the move in a backward compatible way:

  1. Move _NoGPU from util.py to error.py.
  2. Adjust all uses of _NoGPU to import it from error.
  3. Add GPUNotAvailableError to module-hoomd-errors.rst so it appears in the documentation.
  4. Remove the definition of GPUNotAvailableError from util.py and replace it with an import of hoomd.error.GPUNotAvailableError to preserve backward compatibility.
  5. Note the deprecation in deprecated.rst.

Merge trunk-minor into move_GPUNotAvailableError first to avoid creating conflicts in deprecated.rst.

@joaander joaander added the validate Execute long running validation tests on pull requests label Jan 12, 2024
Copy link
Member

@joaander joaander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@joaander joaander merged commit 4bc4498 into trunk-minor Jan 12, 2024
40 checks passed
@joaander joaander deleted the move_GPUNotAvailableError branch January 12, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validate Execute long running validation tests on pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants