-
Notifications
You must be signed in to change notification settings - Fork 7
DEV: bring build system up to date #44
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
Conversation
| def gf(self, z, **kwds): | ||
| """Green's function.""" | ||
| raise NotImplementedError('This is just a placeholder') | ||
| def gf(self, z, **kwds): ... # noqa: D102 |
Check notice
Code scanning / CodeQL
Statement has no effect Note test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 7 months ago
To fix the issue, the gf method should be explicitly marked as abstract using the abc module. This will make it clear that the method is intended to be implemented by subclasses. The GfProperties class should inherit from abc.ABC (Abstract Base Class), and the gf method should be decorated with @abc.abstractmethod. This approach is more explicit and aligns with Python's conventions for abstract methods.
Steps to implement the fix:
- Import the
ABCandabstractmethodclasses from theabcmodule. - Modify the
GfPropertiesclass to inherit fromABC. - Decorate the
gfmethod with@abstractmethodand remove the ellipsis (...).
-
Copy modified line R17 -
Copy modified line R37 -
Copy modified lines R52-R55
| @@ -16,2 +16,3 @@ | ||
| from scipy import integrate | ||
| from abc import ABC, abstractmethod | ||
|
|
||
| @@ -35,3 +36,3 @@ | ||
|
|
||
| class GfProperties: | ||
| class GfProperties(ABC): | ||
| r""" | ||
| @@ -50,3 +51,6 @@ | ||
|
|
||
| def gf(self, z, **kwds): ... # noqa: D102 | ||
| @abstractmethod | ||
| def gf(self, z, **kwds): # noqa: D102 | ||
| """Abstract method for Green's function.""" | ||
| pass | ||
|
|
| from . import old_pade | ||
| from .context import gftool as gt, gt_pade | ||
| import gftool as gt | ||
| import gftool.pade |
Check notice
Code scanning / CodeQL
Unused import Note test
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 7 months ago
To fix the issue, we will remove the unused import statement import gftool.pade from line 7. This will eliminate the unnecessary dependency and improve code readability without affecting the functionality of the script.
| @@ -6,3 +6,2 @@ | ||
| import gftool as gt | ||
| import gftool.pade | ||
| from gftool.tests import _old_pade as old_pade |
Use modern build system based on
pyproject.htmland install the package instead of using path hacks. We switch from versioneer, which had some hiccups, to setuptools-scm. Use ruff as linter instead of several other tools. Employ pre-commit.