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

hard vs. soft dependencies #32

Open
lheagy opened this issue Apr 9, 2022 · 10 comments
Open

hard vs. soft dependencies #32

lheagy opened this issue Apr 9, 2022 · 10 comments
Labels

Comments

@lheagy
Copy link
Member

lheagy commented Apr 9, 2022

I think much like the discussion we had at the April 6 SimPEG meeting about keeping the core set of dependencies of SimPEG quite lightweight, it would be good to do that for geoana as well.

Currently, the requirements are:

        'future',
        'numpy>=1.8',
        'scipy>=0.13',
        'matplotlib',
        'properties',
        'vectormath',
        'utm',
        'empymod'

#31 will remove the properties and vectormath dependencies.

I propose that the core set of dependencies be limited to

  • numpy
  • scipy

and that utm, empymod, matplotlib are all soft dependencies, much like we have done in discretize.

@lheagy lheagy added the refactor label May 3, 2022
@lheagy
Copy link
Member Author

lheagy commented Jun 29, 2023

Some of this has been resolved with removing properties (in #31), but we are still requiring utm for example, which isn't necessary for most geoana code

@prisae
Copy link
Member

prisae commented Jun 29, 2023

You could reduce the core dependencies to scipy only, as numpy is a dependency of scipy anyway and handled that way.

@jcapriot
Copy link
Member

jcapriot commented Jul 7, 2023

I have reduced it down to just numpy, scipy, and libdlf (which itself only depends on numpy).

@rowanc1
Copy link
Member

rowanc1 commented Jul 7, 2023

If utm is removed, I think this will start to work in JupyterLite:
image

This would open up all sorts of possibilities for adding interactive widgets to static websites!

@jcapriot
Copy link
Member

jcapriot commented Jul 7, 2023

Well, that's great! Also, I was having some very odd build-matrix errors due to numba on the conda-forge side trying to release 0.4.1 on conda-forge/geoana-feedstock#21

@rowanc1
Copy link
Member

rowanc1 commented Jul 7, 2023

I think that it should now work on pyodide, but it needs a built bundle:
https://packaging.python.org/en/latest/tutorials/packaging-projects/#generating-distribution-archives

This is the pyodide docs:
https://pyodide.org/en/stable/usage/faq.html#why-can-t-micropip-find-a-pure-python-wheel-for-a-package

Do you know how to do this @jcapriot?

For example this repo has:
image

geoana only has the source:
image

@jcapriot
Copy link
Member

jcapriot commented Jul 7, 2023

We could provide an py3 any-wheel. (There are external libraries in geoana, but I've been sure to have fall-back python only versions of them as well).

@rowanc1
Copy link
Member

rowanc1 commented Jul 7, 2023

I think that if we get that up there we can do things like this really easily! This still requires a server, but would love to be able to bypass that and get it up and running in jupyter lite!

geoana

There are a few examples of doing that here.

@rowanc1
Copy link
Member

rowanc1 commented Jul 8, 2023

Yep, tested locally and all we need is the geoana-0.5.0-py3-none-any.whl which is the result of python3 -m build in the repository as is and then getting that up to pypi. When that is done, it will work in JupyerLite/pyodide, and allows for all sorts of cool things. I will put an example together.

@rowanc1
Copy link
Member

rowanc1 commented Jul 8, 2023

Works if we add that to the build!

geoana.mp4

Source:
https://rowanc1.github.io/geoana-docs/

Right now I am just hosting the built file on curvenote, but hopefully we can get it on pypi!

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

No branches or pull requests

4 participants