sunpy / ndcube

A base package for multi-dimensional contiguous and non-contiguous coordinate-aware arrays.
http://docs.sunpy.org/projects/ndcube/
BSD 2-Clause "Simplified" License
44 stars 48 forks source link

NDCube.squeeze method #669

Closed mihailbankov closed 7 months ago

mihailbankov commented 7 months ago

Creates the NDCube.squeeze method as described in the issue, similar to the numpy equivalent. This method removes (specified) axis with length 1. Testing for the method is also included. Resolves #616

DanRyanIrish commented 7 months ago

At first glance, the test coverage does seem a bit weird. I would suggest making the changes to the main code, which will also require some changes to the tests. If the coverage still looks weird, we can take a closer look then.

mihailbankov commented 7 months ago

I changed the line for isinstance where I put int; On the last line i changed arr to item; Aside from that I think there are no real changes to the code you proposed. The tests were also changed to test the new code.

nabobalis commented 7 months ago

Thanks for the PR @mihailbankov