Comments (8)
I'm open to renamings, but I would want to avoid overlap with pyplot namespace in case we ever switch to monkeyclassing
from mplhep.
You should not try to avoid name clashes. We have namespaces to resolve the ambiguity. That's the reason everyone writes plt.hist
instead of just hist
, so that this package can also have a hist
.
from mplhep.
Look at cupy, jax, etc, these re-implement the numpy interface with the exact same names and calling conventions under a different namespace, precisely so that you can do
# import numpy as np
from jax import numpy as np
# do numpy stuff
from mplhep.
from mplhep.
Ok, you are right, it is not exactly the same situation. If I understand correctly, you are already preparing for a possible merging of mplhep into pyplot. I think this is not going to happen very soon, and even when it is, the names will be debated again anyway. You cannot anticipate how that merging will go. The matplotlib guys could decide to place this in mpl_toolkit, then you would have an extra namespace anyway.
For now, we should use names that are easy to type. I like the idea of imitating the pyplot.hist and hist2d interface, so that it is easy to switch over and you do not have to relearn another interface, that is great. However, the following should work
mplhep.hist(*np.histogram(data))
from mplhep.
@HDembinski Would you find it a reasonable solution to alias the two for now? hist = histplot
, hist2d = hist2dplot
?
from mplhep.
Yes, and to deprecate histplot
and hist2dplot
.
from mplhep.
This is the deprecation decorator I use in iminuit, feel free to copy this or allow me to make a PR with the change.
https://github.com/scikit-hep/iminuit/blob/develop/iminuit/_deprecated.py
from mplhep.
Related Issues (20)
- BUG: cmax/cmin won't be respected if extended past data
- [Security] Workflow publish-package.yml is using vulnerable action actions/checkout
- Suppress `yerr` drawing globally HOT 3
- mplhep styles with contourf log scale causes hang HOT 8
- Chaning colors of bars created by histplot makes bar position change HOT 2
- Add HEAD of dependencies GHA workflow HOT 1
- Upload of pytest_results artifact 'fails with no files were found' HOT 3
- `density=True` does not account for bin edges
- bug: mplhep logo placement is slow.. HOT 1
- histplot() with histtype="errorbar" crashes when data contains inf or nan HOT 3
- ENH: Add a `density` option for hist2dplot?
- mplhep LHCb2 style conflicts with subplots_adjust(hspace=0) HOT 1
- ENH: Gallery HOT 2
- CI failing HOT 1
- Add CITATION.cff
- Custom text location HOT 3
- Use gh-action-pypi-publish v1.7.0+ APIs
- Matplotlib warnings
- Histplot errorbars HOT 3
- [Bug] histplot raises IndexError when plotting an histogram with one bin HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mplhep.