Comments (13)
Implemented in #35
from netcdf.
Would something like this do (partially) the trick ?
lwandrebeck@4ce77a9
from netcdf.
Could you create an enum for endianess, which you convert to the corresponding value? It would also be nice to have both a setter and a getter for the endianess. The signature of the setter should be &mut self
.
from netcdf.
What about lwandrebeck@e0afced ?
from netcdf.
Starting to look good now! Feel free to open a PR so I can comment directly on it, and let travis have a go at it.
endian_value
should return error::Result<Endianness>
and enum Endianness
should #[derive(Debug, Copy, Clone)]
.
There should also be a test that uses these methods to ensures they are visible to the user. You don't have to test whether the underlying netcdf library actually sets this.
from netcdf.
Endianness
could also derive PartialEq
, but then the equality native <-> little/big has to be decided.
from netcdf.
Ok, I’m on test part. It looks like netcdf does not use Native, but converts silently to Little or Big depending on the arch the file is created on. I need to dig a bit deeper about that.
from netcdf.
Maybe one can put Native
, but you will never get Native
in return?
from netcdf.
It seems even if you give Big on create, it is written as Little on a little-endian arch.
« and the library takes care of the conversions on reading or writing, so that programs using the library alsways deal with the data in native form. That's one of the purposes of the netCDF library, to insulate programmers from having to know anything about characterisitics of the computer on which the data was written. » from https://www.unidata.ucar.edu/support/help/MailArchives/netcdf/msg11257.html
from netcdf.
I left test out of #35 as we need to dive a bit more into netcdf lib and decide what and how to test endianness.
from netcdf.
Might be that the endianess is not set before it is synced. You could try putting a value then reading it back out. The only purpose of setting the endianess ourself would be to avoid endianess conversion on the target, otherwise it should be hidden.
from netcdf.
We could test the true endianess once #33 is implemented.
from netcdf.
Ok, I’ve fixed up a stupid bug introduced by myself in test.
Native is automatically converted by netcdf into either Little or Big. Adding test to PR.
from netcdf.
Related Issues (20)
- Enable shuffle filter HOT 5
- Change selectors for put/get
- Chunks iterators HOT 8
- Build netcdf-c from source HOT 1
- Release v0.4.0 HOT 1
- Compilation fails on Rust 1.42.0 Nightly HOT 3
- codecov and coveralls coverage broken HOT 1
- not being linked properly on windows for end binary HOT 1
- Hash of file changes after opening with rust-netcdf HOT 3
- All paths should accept and return OsString HOT 2
- Investigate and fix docs.rs build HOT 1
- ncdap_test not existing in latest netcdf-src HOT 1
- CI failed HOT 1
- Troubles reading xarray netcdf files HOT 5
- Update to ndarray 0.14.0 HOT 2
- netcdf features should be enabled if available HOT 1
- Update netcdf-src to latest version of netcdf-c
- Add derive macros for more advanced types
- CF Time attribute HOT 13
- thread 'main' panicked at 'Unable to locate HDF5 root directory and/or headers.' HOT 10
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 netcdf.