flaport / inverse_design

https://flaport.github.io/inverse_design
Apache License 2.0
16 stars 5 forks source link

Fiddle with `setup.py` to make installable with a single command? #20

Open jan-david-fischbach opened 1 year ago

jan-david-fischbach commented 1 year ago

I'd love to be able to install this repo in a single command similar to pip install inverse-design. I have prepared a branch that tries to achieve that. However, I had to modify setup.py to get the local rust "sub-package" to install:

    install_requires = requirements + 
         [f"inverse_design_rs @ file://localhost/{current_directory}/rust#egg=inverse_design_rs"],

It doesn't quite seem to be supposed to be done like this... Another option would be to separate the two into different git repos (and distribute both on pypi). However, that seems like a lot of effort to me.

My current install prompt

pip install git+https://github.com/Jan-David-Black/inverse_design_strict_fabrication.git@easy_install

It assumes rustc and cargo are installed on the system.

Using the prompt we can run our notebooks on colab also: https://colab.research.google.com/github/Jan-David-Black/inverse_design_strict_fabrication/blob/easy_install/notebooks/11_ceviche_challenges.ipynb

flaport commented 1 year ago

I think the best way would be to build wheels for all platforms in CI for this. Maybe something similar as what I'm doing for klujax, but using Rust in stead of C++.

But your current solution is a good first implementation ;-)