GithubHelp home page GithubHelp logo

Comments (7)

hadfieldnz avatar hadfieldnz commented on August 17, 2024

Sorry for missing line breaks in the code snippets above. I didn't notice the Preview pane so didn't preview my Markdown.

from cmocean.

kthyng avatar kthyng commented on August 17, 2024

Hi! Sorry for my delay, been traveling.

You're right that the import statement isn't currently correct. Earlier on, plots was included in the main install, but some people preferred that it be kept separate so as to not require more packages than strictly necessary. So, plots has been a bit separate. I did try to have multiple ways to install cmocean on conda-forge, but I wasn't able to get it to work and gave up as I recall. Here is my current thinking about your suggestions, in backward order:

Modifying the plot_gallery demonstration code on the front page to use the "from cmocean import plots" idiom. (This is widely used by other packages.)

What about just adding "plots" to the end of import cmocean:

import cmocean.plots
cmocean.plots.plot_gallery()

Making colorspacious a dependency of cmocean on conda-forge. And maybe also viscm

I would like to find more info on this. @tacaswell or @ocefpaf do you have any advice about how best to approach this? Do you think it's too much to have viscm and colorspacious required when many people won't want to use them? Is it reasonable to have options built into the conda-forge build (which was my original intent)? @ocefpaf you were nearby when I was trying to get this to work last year at SciPy and it seems like it is not trivial.

from cmocean.

ocefpaf avatar ocefpaf commented on August 17, 2024

The "pip install cmocean[plots]" trick does not carry over to conda, i.e. "conda install cmocean[plots]" has exactly the same effect as "conda install cmocean": it installs cmocean only.

conda does not have the concept of optional dependencies. We can either make a bulkier package with all the optional dependencies or the user should install them separately.

Making colorspacious a dependency of cmocean on conda-forge. And maybe also viscm

Looks like them are light enough to be a core dependency.

@ocefpaf you were nearby when I was trying to get this to work last year at SciPy and it seems like it is not trivial.

I don't remember but we can try and see how hard it is.

from cmocean.

kthyng avatar kthyng commented on August 17, 2024

This looks promising!

from cmocean.

kthyng avatar kthyng commented on August 17, 2024

Sorry I neglected this for so long! I'm trying to get cmocean modernized to now.

conda does not have the concept of optional dependencies

@ocefpaf isn't that what you did in conda-forge/cmocean-feedstock#14?

from cmocean.

ocefpaf avatar ocefpaf commented on August 17, 2024

@ocefpaf isn't that what you did in conda-forge/cmocean-feedstock#14?

I think so. At least it is what the GitHub breadcrumbs tells me :-P

from cmocean.

kthyng avatar kthyng commented on August 17, 2024

I think colorspacious is now just installed with cmocean through conda-forge.

@hadfieldnz I'm going to close this now since I think you can get the behavior you want with

import cmocean.plots
cmocean.plots.plot_gallery()

You can reopen it for further discussion.

from cmocean.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.