Comments (5)
Hi @sadielbartholomew - great, sounds like we have a plan, then. I'm happy to make the suggested change to the docstring for now, and we'll refactor the Constructs
object for a future (not 1.8.9.0
) release.
from cfdm.
Hi @sadielbartholomew, the short answer is that in the current CF data model, cell method constructs must be orderable but there is no defined ordering for any other type of construct (such as dimension coordinate constructs).
Would this change to the docstring work?
For cell method constructs, the predetermined order is that in
which they where added. There is no predetermined ordering for all other
construct types, and a exception is raised if any non-cell method constructs
are present.
from cfdm.
Just had a look around the code a bit more .... (e.g.
Lines 256 to 257 in e908dc8
I'm reminded that some of this logic stems from the fact that pre Python3.7 we needed to use OrderedDict
for cell methods, but that is not necessary for 3.7 onwards. I think we are close to dropping 3.6 support (meaning we should do this!), as it is no longer supported by numpy
1.20. In this case, we can simplify (and speed up!) the code by getting rid of the "ordered" functionality completely (including the Constructs.ordered
method) - we just say that constructs, of any flavour, are returned in the order in which they were set. This order happens to be arbitrary for all constructs except cell methods, for which this order determines the sequence in which the cell methods were applied to the data.
How does that sound?
from cfdm.
Thanks for the clarification @davidhassell. That makes sense, though as it is currently I don't think that context is clear (I certainly got confused as you can see!).
Would this change to the docstring work?
That makes it much clearer, thanks. Would you like to make that change or shall I (I guess we can't drop 3.6 support immediately for the next release)?
In this case, we can simplify (and speed up!) the code by getting rid of the "ordered" functionality completely (including the Constructs.ordered method) - we just say that constructs, of any flavour, are returned in the order in which they were set.
Brilliant, let's do that. Simple and means we don't need to treat cell methods as the one orderable special case.
from cfdm.
Great, thanks @davidhassell.
from cfdm.
Related Issues (20)
- New "original filenames" methods
- Incorrect data assignment with some multiple list indices HOT 4
- Allow data to be omitted from netCDF files during `cfdm.write`
- Zero values reported by `repr` on fully-masked datetime arrays
- Slight change in `_FillValue` property value on write-read
- Creat new `SubsampledSubarray` subclass for the case of no standardised interpolation algorithm
- Document accepted argument types for `source` parameters
- (Document) rename of default branch from `master` to `main` HOT 1
- Relocate the call to `_customize_read_vars()` in `NetCDFRead.read`
- Improve source docstrings in `__init__` methods
- Prepare for v1.10.0.2 HOT 2
- New `ignore_properties` keyword to `cfdm.unique_constructs` HOT 1
- Incorrect `formula_terms` in output netCDF files in some cases
- External cell measure netCDF variable names are not always preserved by `cf.write`
- Allow file missing data indicator values to be stored on `NetCDFArray` instances
- Error from `Data.second_element` for some data shapes
- Make `cfdm.read` always return unicode strings from netCDF files HOT 1
- Error when writing to disk coordinates with a computed_standard_name
- Very slow reads of datasets with compession by gathering or DSG ragged arrays
- Reading of `http://` remote files does not work HOT 1
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 cfdm.