Giter Site home page Giter Site logo

List return about cdo-bindings HOT 7 CLOSED

try2code avatar try2code commented on August 21, 2024
List return

from cdo-bindings.

Comments (7)

Try2Code avatar Try2Code commented on August 21, 2024

Hi + sorry for the delay
the problem is, that this solutions looks good for a single line (showname,showdate,showtime,showyear,showcode) but becomes tricky for things like showlevel, where multiple vertical axes are shown (one line per variable). it looks like this

% cdo showlevel ../icon/oce.nc                                                                                                                                                                                       [Wed 2017-02-15|16:01:52]
 250 750 1250 1750 2250 2750 3250 3750 4250 4750
 0
 0
 0
 0
 0
 250 750 1250 1750 2250 2750 3250 3750 4250 4750
 250 750 1250 1750 2250 2750 3250 3750 4250 4750
 250 750 1250 1750 2250 2750 3250 3750 4250 4750
 250 750 1250 1750 2250 2750 3250 3750 4250 4750
 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
 250 750 1250 1750 2250 2750 3250 3750 4250 4750
 25 100 250 500 875 1400 2100 3000 4000 5000
 25 100 250 500 875 1400 2100 3000 4000 5000

To be consistent with your suggestion the return value should be a nested array, which reduces the beauty of it.
Do you have any suggestion for this?

cheers
ralf

from cdo-bindings.

beatorizu avatar beatorizu commented on August 21, 2024

It could be added a argument to return a list or return a string. This let us choose the format of output.

from cdo-bindings.

Try2Code avatar Try2Code commented on August 21, 2024

I finished a first guess. Could you have a look and run some tests on it? Pls check if it's useful for you

cheers
ralf

from cdo-bindings.

Try2Code avatar Try2Code commented on August 21, 2024

Added some code to return the list directly if the operator outputs only a single line like showname, showdate or showtimestamp.

from cdo-bindings.

Try2Code avatar Try2Code commented on August 21, 2024

I close this one - IMO the feature is there. but pls, feel free to open an new ticket, if anything is missing.

cheers + thanks !
-ralf

from cdo-bindings.

beatorizu avatar beatorizu commented on August 21, 2024

Hi, again + sorry for the delay

I've tested the autoSplit argument and it works fine. Thank you for the improvement 👍

In [3]: cdo.showdate(input='/path/to/some_file.nc', autoSplit='  ')
Out[3]: 
['2017-04-18',
 '2017-04-19',
 '2017-04-20',
 '2017-04-21',
 '2017-04-22',
 '2017-04-23',
 '2017-04-24',
 '2017-04-25']

from cdo-bindings.

Try2Code avatar Try2Code commented on August 21, 2024

thx for testing and your input!

from cdo-bindings.

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.