Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle shaped and zero-length input data in cxctime2plotdate #19

Merged
merged 1 commit into from
Oct 22, 2021

Conversation

taldcroft
Copy link
Member

@taldcroft taldcroft commented Oct 18, 2021

Description

cxctime2plotdate previously only accepted 1-d data, and crashed for a zero-length input. This fixes that.

A driver for this change was the arc/make_timeline.py was getting exceptions due to the zero-length problem.

Testing

  • Passes unit tests on MacOS (with new tests)
  • [n/a] Functional testing

@jeanconn
Copy link
Contributor

Do we want to just update it to deal with NxM shapes or should arbitrary lists of lists just work too?

@taldcroft
Copy link
Member Author

I don't see any need for arbitrary ragged lists of lists. It does currently handle an arbitrary regular list of lists (an N-dimensional cube of data) but not a ragged list of lists.

@jeanconn
Copy link
Contributor

Sounds good. I was wondering if the implementation might actually be simpler but also couldn't think of a use case.

@taldcroft
Copy link
Member Author

Dealing with ragged lists of lists is actually a huge pain. Unless there is a very strong driver the right answer is to delegate to np.asarray and fail if that doesn't work.

@taldcroft taldcroft merged commit 59fffbc into master Oct 22, 2021
@taldcroft taldcroft deleted the handle-shaped-input branch October 22, 2021 14:16
@javierggt javierggt mentioned this pull request Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants