callumrollo / cmcrameri Goto Github PK
View Code? Open in Web Editor NEWMaking Fabio Crameri's perceptually uniform colourmaps for geosciences available on PyPI and conda-forge
Home Page: http://www.fabiocrameri.ch/colourmaps.php
License: Other
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
The pyproject.toml
(and thus PyPI entry) lists https://callumrollo.github.io/cmcrameri as a documentation link. However, that link generates a 404 page.
Hi there,
Nice work on integrating the Scientific colour maps into python (and pip). Could you also update the version of the code in pip from colour maps version 7 to version 8?
Thanks,
Zak
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()
Hello! Your package looks like a more-complete and better version of my own package (https://github.com/gwerbin/scientific-colourmaps) which has the same name on PyPI (https://pypi.org/project/scientific-colourmaps/), and which I have all but completely abandoned.
If you are interested, I'd be happy to turn over the scientific-colourmaps
name to you. I have no personal interest in maintaining my own package, and I will probably be using yours in going forward in my own work.
As detailed in #24 by tobiscode, batlowW and batlowK are now acceptable as categorical colormaps
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
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 version out today!
https://zenodo.org/record/4491293
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.
@callumrollo would you be OK with the branch name change?
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.