Enable plotting of cfdm fields with cfplot
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- data-visualization
Research direction
Start by reproducing the cfp.con examples with tas_A1.nc, comparing the working cf field with the failing cfdm field and its reported shapes. Trace the cfplot input validation around check_data; done means a cfdm field can be plotted successfully, with any required coordination between cfdm and cfplot resolved.
Written by the indexing model from the issue text.
Description
In recent discussions relating to the CF Training course, we agreed it would be useful to be able to plot cfdm fields, and not just cf-python fields, with cfplot. Some work would probably need to be done on both the cfdm and cfplot side to make this possible.
For example, with the latest versions of all of the libraries, taking a simple example (lifted from the documentation and using one of the sample data sets) with trying to plot a field read-in via cf and cfdm separately, the cf field plots fine but the cfdm one runs into some cfplot errors due to shape:
>>> import cfplot as cfp
>>> import cf
>>> import cfdm
>>> cf.__version__
'3.11.0'
>>> cfdm.__version__
'1.9.0.1'
>>> cfp.__version__
'3.1.17'
>>> cf_f = cf.read('tas_A1.nc')[0]
>>> cfdm_f = cfdm.read('tas_A1.nc')[0]
>>> cfp.con(cf_f[0,0::]) # plots successfully
>>> cfp.con(cfdm_f[0,0::]) # errors
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/sadie/anaconda3/envs/cf-env/lib/python3.8/site-packages/cfplot/cfplot.py", line 401, in con
check_data(field, x, y)
File "/home/sadie/anaconda3/envs/cf-env/lib/python3.8/site-packages/cfplot/cfplot.py", line 3779, in check_data
raise Warning(errstr)
Warning:
Input arguments incorrectly shaped:
x has shape:(73,)
y has shape:(1,)
field has shape(1, 73, 96)
Expected x=xpts, y=ypts, field=(ypts,xpts)
x=npts, y=npts, field=npts
or x=[ypts, xpts], y=[ypts, xpts], field=[ypts, xpts]
- Dominant language
- Python
- Stars
- 32
- Forks
- 14
- Avg merge
- 3d 20h
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NCAS-CMS/cfdm
-
Convert to/from iris cubesPossibly taken @davidhassell claimed this 4 days ago. Openenhancement
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Convert from/to `xarray`Possibly taken @davidhassell claimed this 6 days ago. Opendataset read dataset write enhancement xarray
Difficulty 4/5 3-5 days Newbie friendliness 20/100
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 57/100
-
documentation
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Conformance: UGRID check failure reporting missing attrMay be free again @sadielbartholomew claimed this 66 days ago, and no pull request is open. Openbug UGRID
Similar issues
-
eegprep-lean: set channel types from the Zarr group's channel_typePossibly taken @claude claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
sccn/eegprep#668 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
blacklanternsecurity/bbot#3679 ·
Maintainers usually reply within 2 days
-
Link Checker ReportOpenBot Type: Bug Type: Documentation
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
speakeasy-api/speakeasy#2159 ·
Maintainers usually reply within 1 day