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

Breaking the pyqg dependency #5

Open
jdenholm opened this issue Feb 28, 2023 · 3 comments
Open

Breaking the pyqg dependency #5

jdenholm opened this issue Feb 28, 2023 · 3 comments
Assignees

Comments

@jdenholm
Copy link
Contributor

jdenholm commented Feb 28, 2023

The utils.py currently depends on the pyqg repository, but Laure says she would like this equation discovery repository to be completely independent of pyqg .

  • Is dropping the pyqg dependency definitely what we want to achieve?
  • How can we refactor/redesign this repository such that it is standalone with no pyqg dependency?
@jdenholm jdenholm changed the title Breaking the [pyqg](https://github.com/pyqg/pyqg) dependency Breaking the pyqg dependency Feb 28, 2023
@LaureZanna
Copy link
Collaborator

Yes, it would be great to removepyqg dependency so that users can feed in their data without having to install pyqg which is a numerical solver.

@asross
Copy link
Collaborator

asross commented Mar 18, 2023

My take on this is that we should support pyqg and require it for certain things (e.g. computing similarity metrics that are specifically designed for pyqg.Models), but we shouldn't require it for the entire library, since much of the code (e.g. the actual hybrid symbolic procedure) can operate just as easily on an xarray.Dataset.

To accomplish that, I think we'll need to do something like:

  • try importing pyqg and store a boolean indicating whether the import succeeded
  • replace existing type checks for pyqg.Model with something like is_pyqg_model that returns isinstance(pyqg.Model) if the import succeeded and False if the import failed

Does that make sense? I think that's a better approach than removing all references to pyqg altogether, since then it will become very difficult to run the library with pyqg models.

@LaureZanna
Copy link
Collaborator

Thanks @asross; i like the idea. I feel as long as one can use the hybrid symbolic procedure without pyqg that would be really great (including calculating the derivatives).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants