Coder Social home page Coder Social logo

Comments (4)

bluss avatar bluss commented on June 16, 2024

I'm watching for this feature as well. I have been using an untyped (*const u8) interface and would be interested in that kind of low level interface as well, or enough low level access that it can be implemented using the right variable ids with the netcdf-sys interface.

from netcdf.

evomassiny avatar evomassiny commented on June 16, 2024

Hi,
I've implemented an alternative to values_at and values that can be used with a pre-allocated vector, see the related PR.
As for the equivalent of array_at, I don't know how to mutate the raw data of an ArrayD.

@bluss The netcdf-sys interface expose all the "nc_get_vara_*" fonction familly from the original C library, Is this what you need ?

from netcdf.

bluss avatar bluss commented on June 16, 2024

Sure, I'm thinking of nc_get_vara which uses a void *. I have a prototype (using netcdf-sys) that is using it:

    /// Read variable data of any type; without conversion
    ///
    /// # Safety
    ///
    /// The caller must ensure that `ptr` points to a place where the output can
    /// be written safely.
    pub unsafe fn read_at(&self, indices: &[size_type], counts: &[size_type], ptr: *mut u8) -> Result<(), Ety>
    {
        netcdf_lock!();
        check(ns::nc_get_vara(self.group_id, self.id, indices.as_ptr(), counts.as_ptr(), ptr as _))
    }

I have been struggling to find the right way to work with a "foreign typesystem" (netCDF types in this case) and sometimes using enums everywhere seems both redundant and restrictive. The C approach to "generic" is sometimes really effective. That said, I haven't exactly settled on either way to solve it.

from netcdf.

mhiley avatar mhiley commented on June 16, 2024

closed by #21

from netcdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.