Giter Site home page Giter Site logo

callumrollo / cmcrameri Goto Github PK

View Code? Open in Web Editor NEW
119.0 6.0 10.0 1.34 MB

Making Fabio Crameri's perceptually uniform colourmaps for geosciences available on PyPI and conda-forge

Home Page: http://www.fabiocrameri.ch/colourmaps.php

License: Other

Python 100.00%
python matplotlib colourmap scientific-visualization conda-forge pypi

cmcrameri's People

Contributors

arafune avatar callumrollo avatar dependabot[bot] avatar esiddle avatar flolangenfeld avatar kianmeng avatar ocefpaf avatar pre-commit-ci[bot] avatar zmoon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cmcrameri's Issues

BatlowS categorical colormap

I would like to define the matplotlib cycler to use BatlowS but I haven't managed to get it working as I can't access the list of colors for the cycle. Is there already a way of doing so? If not, what would be the best way to implement it?

New release

Let's stay ahead of the curve and release a new version with the matplotlib deprecation fix from #15 ?

Let me know if I can help with that.

Add scientific color map version number

The is a great project! I'm glad that someone finally put this on pip and conda.

I just have two small suggestions:

First, I think that it would be helpful if you could add the version of the Scientific Color Maps that you are using. These get updated from time to time, so it would be good to know what version is being used in cmcrameri. What if you added something like this to the init file? __scm_version = 7.0 or __version_scm = 7.0

Second, as long as you are adding versions, it would be helpful to also define __version. Perhaps the easiest way to do this is with the versioneer project, which takes the version from the tag.

Adding stub file

Adding stub file of cm.py would be very helpful for type checking and auto completing colormaps.

from matplotlib.colors import ListedColormap
from pathlib import Path

paths: list[Path]
cmaps: dict[str, ListedColormap]

def show_cmaps(*, ncols: int = ..., figwidth: int = ...) -> None: ...

acton: ListedColormap
acton_r: ListedColormap
actonS: ListedColormap
bam: ListedColormap
bam_r: ListedColormap
bamako: ListedColormap
bamako_r: ListedColormap
bamakoS: ListedColormap

I generated cm.pyi stub file with this script (mypy needed).

import subprocess
from pathlib import Path

from cmcrameri.cm import cmaps

if __name__ == "__main__":
    subprocess.check_output(["stubgen", "-o", ".", "cmcrameri/cm.py"])

    path = Path(__file__).parent / "cm.pyi"
    assert path.exists()

    with path.open("a", encoding="utf-8") as f:
        for cmap in cmaps:
            f.write(f"\n{cmap}: ListedColormap")

These lines were added for typing paths and cmaps.

paths: list[Path]
cmaps: dict[str, ListedColormap]
paths, cmaps = _load_cmaps()

registering the colormaps with Matplotlib with original name

Is your feature request related to a problem? Please describe.
My problem is I prefer to have something like
import cmcrameri # required in order to register the colormaps with Matplotlib
...
plt.imshow(x, aspect='auto', cmap='batlow')

Describe the solution you'd like
I think we don't need cmap_reg_prefix = "cmc."

I really appreciate if you can explain me how it might be problematic?

Best regards,
Mohammad

Is your ignore word list correct?

In your codespell configuration, you configured it to ignore words:

- repo: https://github.com/codespell-project/codespell
  rev: v2.2.5
  hooks:
    - id: codespell
      args:
        - --ignore-words-list=buda

Based on the documentation, this should be a word list.

The closest buda file I can find is here, it contains a list of numbers.

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.