awesome-panel / panel-chemistry

πŸ§ͺπŸ“ˆ 🐍. The purpose of the panel-chemistry project is to make it really easy for you to do DATA ANALYSIS and build powerful DATA AND VIZ APPLICATIONS within the domain of Chemistry using using Python and HoloViz Panel.
MIT License
119 stars 16 forks source link

Request for Conda support #11

Closed arifin-chemist89 closed 2 years ago

arifin-chemist89 commented 3 years ago

As chemo-informaticians nowadays who use Python, are mainly relied on RDKit to compute about molecule information, it is preferable that that RDKit could be easily bundled in panel-chemistry. But, since RDKit installation with pip is really tedious, registering panel-chemistry in Anaconda repository could help users to use it easily.

scottwsides commented 3 years ago

I'll 2nd this request for a conda package. This would make building large dependency chains with panel-chemistry MUCH easier

MarcSkovMadsen commented 3 years ago

Hi @arifin-chemist89 and @scottwsides

Is the solution below enough for you?

If not could you please describe why not? A better understanding of why a pip package is a problem to you would be my fuel to support a conda package.

Thanks

FAQ

How do I Install with Conda?

You can do

conda install pip
pip install panel-chemistry

You can also include panel-chemistry in your environment.yaml file as described on Stack Overflow: Combining conda environment.yml with pip requirements.txt.

scottwsides commented 3 years ago

Yes, all the things you mention will work. The point is that AFAIK, pip installs will NOT work with condo-build tools. The syntax in a .yaml recipe file for condo-build looks similar to a .yaml env conda file. But they're not exactly the same. condo-build tools are pretty common and allow building large apps with conda python env installed auto-magically. pip is simply not as good as conda.

MarcSkovMadsen commented 3 years ago

Thanks. Now i understand that it’s not only about conda. Then it makes sense om my side.

Jhsmit commented 3 years ago

In my experience once you've pip installed something in a conda environment, you can no longer later conda install something else on top. You'll need to make a new conda env and start over.

I can have a look at deploying to conda-forge, however I only have experience doing so with pure python projects. But when looking the https://github.com/conda-forge/panel-feedstock it seems like there are only minor differences.

scottwsides commented 3 years ago

Jhsmit, in my experience you can conda install after a pip install.... its just 'risky'. Again, its the fact that pip installs are not possible with condo-build tools... which are great for managing packages for large python projects. I've got a workaround right now... but its ugly. A conda package for panel-chemistry would be great.

Jhsmit commented 2 years ago

@MarcSkovMadsen

What is your opinion on converting the current bokeh extension panes (NGL viewer, jsme editor) into ReactiveHTML implementations? I don't know if this is possible for the JSME editor but the NGL viewer is already done.

This would make the project pure python and then we its very easy to distribute on conda-forge as a noarch package. I think it this will make it much easier for people to use it (most of my use cases depend on conda support) and also easier to maintain the package.

However, the disadvantage would be that in the future we can not add any bokeh extensions to panel-chemistry anymore.

MarcSkovMadsen commented 2 years ago

Hi @Jhsmit . I don't think distributing as a conda package depends on whether its a Bokeh or ReactiveHTML based extension. But I don't know for sure, since I have not tried it.

But I do agree converting to ReactiveHTML would make things easier. I'm all for it. But I have a few thoughts on this. And that is that

MarcSkovMadsen commented 2 years ago

FYI. I've requested panel-chemistry added to conda-forge in https://github.com/conda-forge/staged-recipes/pull/17383.

scottwsides commented 2 years ago

Thats awesome! It will make my life a lot easier! When will it be ready... or should I just check conda periodically?

Jhsmit commented 2 years ago

I thought that (although I have never tried it) distributing packages on conda-forge which are not pure python, and for example have js components, is more complicated. For example, the panel-feedstock repo has an additional index.ts file in the recipe directory.

If we would like panel-chemistry to be used as as component for larger projects, I think we should relax the version requirements as much as possible. Currently the requirements are panel==0.12.6 and bokeh==2.4.2 but this can cause problems down the line for projects with panel-chemistry as dependency. So I would propose to change that to >= requirements instead of pinning them.

wrt to the js files, I have very little experience in javascript/html but I'm trying to dip my toes into it a little bit. At some point I would like to implement the full Mol* toolkit (https://molstar.org/) for panel-chemistry. It is a continuation of the NGL viewer (and other libraries) and offers a lot of functionality.

The __js_files__ or __js__modules__ would be defined within panel-chemistry of is this existing functionality? Similar to the __javascript__ on ReactiveHTML?

How would you (roughly) then use the web components in panel for R/Rust?

MarcSkovMadsen commented 2 years ago

Hi @scottwsides , @Jhsmit , @arifin-chemist89

The package is now available on conda-forge.

I tested it out via

conda create --name panel-chemistry -c conda-forge panel-chemistry
conda activate panel-chemistry
panel serve 'tests\tests\test_jsme_editor.py' --auto --show

And it seems to work.

image

Please try it out and open new issues if there are things not working with conda.

Thanks for requesting this and happy new year.

scottwsides commented 2 years ago

For a conda-build recipe listing panel-chemistry as a dependency... I'm seeing the following. they look like warnings but the docker image in which I'm building seems to have problems. Any ideas?

=> => # WARNING:conda.models.version:Using . with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 2., but conda is ignoring the . and treating it as 2
=> => # WARNING conda.models.version:get_matcher(537): Using .
with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 2., but conda is ignoring the . and treating
=> => # it as 2
=> => # WARNING:conda.models.version:Using . with relational operator is superfluous and deprecated and will be removed in a future version of conda. Your spec was 3., but conda is ignoring the .* and treating it as 3
=> => # WARNING conda

MarcSkovMadsen commented 2 years ago

Hi @scottwsides

Could you open a specific issue on this one and include a minimum, reproducible docker file?

Then I could try to build and understand as well. Thanks.

scottwsides commented 2 years ago

thanks marc, I'll think about how best to do this. My image has proprietary stuff in it including a base layer that I don't manage.

MarcSkovMadsen commented 2 years ago

You can copy your files. Then start removing functionality from the Dockerfile until it is as small as possible. Likewise with your environment.yaml file. It can probably be minimized to almost only panel-chemistry.

I would expect you can end up with a very simple Dockerfile and a very simple environment.yaml file.

scottwsides commented 2 years ago

So its conda builds with a recipe and the deps get complicated. I dont use environment.yaml file... I use conda yaml recipes. I have already paired back the docker file to the broken line... and its a command I can enter the running container and execute fine. It must be some subtle way that conda build/install for panel-chemistry is interacting the env.