Comments (7)
Thanks @davidhassell for the report of this. As discussed externally yesterday, I was not aware of this particular segmentation faulting before and I think your suggestion here sounds very wise.
I'll put in the update today and close this Issue to let you know it has been done, ready for the next release (date still TBC).
from cf-plot.
Note further context has been discovered on this: see cedadev/ceda-jaspy-envs#138. I am holding on making the update here until I have upgraded all the NCAS-CMS Data Tools to minimum Python version 3.9 in turn after setting up a single-document cf-plot changelog, anyhow.
from cf-plot.
Hi David. I looked into this earlier and sadly there is a complication in that setting as a minimum matplotlib v3.8.3 or above means Python 3.9 or above is required. I can tell this from applying the following diff
to enforce to that updated version:
diff --git a/setup.py b/setup.py
index 7aa2522..2daf5ae 100644
--- a/setup.py
+++ b/setup.py
@@ -26,10 +26,10 @@ setup(
package_dir = {"cfplot":"cfplot"},
package_data = {"cfplot": package_data},
include_package_data = True,
- install_requires = ["matplotlib >=3.1.0",
- "cf-python >= 3.9.0",
- "scipy >= 1.4.0",
- "cartopy >= 0.17.0"
+ install_requires = ["matplotlib>=3.8.3",
+ "cf-python>=3.9.0",
+ "scipy>=1.4.0",
+ "cartopy>=0.17.0"
],
url = "http://ajheaps.github.io/cf-plot",
license = "LICENSE.txt",
after which upon attempted reinstallation, I see:
$ pip install -e . ─╯
Obtaining file:///home/slb93/git-repos/cf-plot
Preparing metadata (setup.py) ... done
INFO: pip is looking at multiple versions of cf-plot to determine which version is compatible with other requirements. This could take a while.
ERROR: Ignored the following versions that require a different python version: 3.8.0 Requires-Python >=3.9; 3.8.0rc1 Requires-Python >=3.9; 3.8.1 Requires-Python >=3.9; 3.8.2 Requires-Python >=3.9; 3.8.3 Requires-Python >=3.9
ERROR: Could not find a version that satisfies the requirement matplotlib>=3.8.3 (from cf-plot) (from versions: 0.86, 0.86.1, 0.86.2, 0.91.0, 0.91.1, 1.0.1, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1rc1, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 2.0.0b1, 2.0.0b2, 2.0.0b3, 2.0.0b4, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1, 2.0.2, 2.1.0rc1, 2.1.0, 2.1.1, 2.1.2, 2.2.0rc1, 2.2.0, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 3.0.0rc2, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.1.0rc1, 3.1.0rc2, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.0rc1, 3.2.0rc3, 3.2.0, 3.2.1, 3.2.2, 3.3.0rc1, 3.3.0, 3.3.1, 3.3.2, 3.3.3, 3.3.4, 3.4.0rc1, 3.4.0rc2, 3.4.0rc3, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.5.0b1, 3.5.0rc1, 3.5.0, 3.5.1, 3.5.2, 3.5.3, 3.6.0rc1, 3.6.0rc2, 3.6.0, 3.6.1, 3.6.2, 3.6.3, 3.7.0rc1, 3.7.0, 3.7.1, 3.7.2, 3.7.3, 3.7.4, 3.7.5)
ERROR: No matching distribution found for matplotlib>=3.8.3
I believe cf-python still has a minimum Python version of 3.8, and I don't want to jump ahead of it.
Given the above, how about, for now, we work out the versions of matplotlib
which seg fault with esmpy
and exclude those in particular, instead of setting a minimum version? That way we can still keep some versions of it which allow for Python 3.8 (and possibly below also for cf-plot, I am yet to test which Python versions work and it is not well documented)?
from cf-plot.
Hi Sadie, why don't we push all of the cf* stable to Python 3.9? It's been the minimum version for the last two version of numpy, afterall.
from cf-plot.
Good idea David, that sounds simpler and as you imply we wouldn't be too far in time from doing that anyway.
As agreed today, we won't do this until after we do our new release set of cf-python and cfdm, due to be done tomorrow.
from cf-plot.
Now we have completed the release set, I can update the minimum version. However, first I would like to address #19 so that I have a single change log I can update when I add new features, make bug fixes, or, as in this case, update dependencies. So I will first do that. By the end of this week at the latest I should have both that and this task completed and will report back here.
from cf-plot.
Hi @davidhassell, I have had a little look at this, this morning. Unfortunately I still do see seg faults with matplotlib==3.8.3
, however interestingly (you may have noticed yourself), the order of importing cf
and cfplot
can enable or disable the seg faulting, somehow:
Seg faults
Python 3.12.0 | packaged by conda-forge | (main, Oct 3 2023, 08:43:22) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cf
>>> import cfplot as cfp
>>> f = cf.read("../source/data/tas_A1.nc")
>>> cfp.con(f[0].subspace(time=15))
zsh: segmentation fault (core dumped) python
so that's a work-around for folk, at least (I imagine it will be much more common for people to do the order of imports above, with cf
first). I'll have a little explore in the matplotlib
and esmpy
Issue Trackers in case anyone has reported this environment behaviour and see if it is in the process of being fixed.
Works!
Python 3.12.0 | packaged by conda-forge | (main, Oct 3 2023, 08:43:22) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cfplot as cfp
>>> import cf
>>> f = cf.read("../source/data/tas_A1.nc")
>>> cfp.con(f[0].subspace(time=15))
/home/slb93/miniconda3/envs/cf-env-312/lib/python3.12/site-packages/cartopy/io/__init__.py:241: DownloadWarning: Downloading: https://naturalearth.s3.amazonaws.com/110m_physical/ne_110m_land.zip
warnings.warn(f'Downloading: {url}', DownloadWarning)
from cf-plot.
Related Issues (20)
- Remove duplicate README
- Flesh out README with useful information and showcase of plots
- Create and add 'Cheat Sheet' to extend cf-python one
- Flesh out optional metadata in `setup.py`
- Move detailed release notes from separate pages to new changelog
- Docs: work through & fix Sphinx build warnings (& occasional error) HOT 1
- Add `ajheaps.github.io` build to 'Older documentation' page
- Distribution-specific files: remove from repo & add to `.gitignore` HOT 1
- Populate `.gitignore` from Python template
- Convert docstrings into standard (propose Google) docstring format
- Add logging to improve upon `if verbose: print(<msg>)` statments
- Support 3D plotting through interface to e.g. `GeoVista`
- Docs: change (HTML) theme to one with light & dark mode toggle
- Default colourbar `extend='max'` when minimum level or value is zero HOT 2
- Consistent string formatting, esp. update long string creation via `+=` HOT 2
- Remove dead code (as an anti-pattern)
- Consolidate `else`/`if` conditional logic
- Consolidate `setvars` setting of `plotvars` attributes
- User messaging: remove (excessive) use of manual line breaking
- `gclose` shows no view when `gopen` is called with `file` set
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 cf-plot.