jhuapl-boss / intern

Python SDK for interacting with the BossDB REST API
Apache License 2.0
21 stars 15 forks source link

Refactor slicing array to _normalize_key method and report voxel size relative to resolution #104

Closed CBroz1 closed 1 year ago

CBroz1 commented 1 year ago

I noticed some duplicated code across intern.convenience.array's __getitem__ and __setitem__ methods, which I condensed to a normalize_key private method.

I'm separately interested in using this _normalize_key method for my work at DataJoint.

I ran nose2 -c jenkins_files/unittest.cfg both before.log and after.log my commit. Failures seem either pre-existing or related to my lack of CloudVolume.

CBroz1 commented 1 year ago

I also made a change to the _BossDBVolumeProvider that would multiply the base voxel size by 2^(resolution integer).

It was previously the case that voxel size was the same regardless of resolution.

array("bossdb://takemura/takemura13/image", resolution=0).voxel_size == (4.4, 4.4, 44.0)
array("bossdb://takemura/takemura13/image", resolution=2).voxel_size == (17.6, 17.6, 176.0)
j6k4m8 commented 1 year ago

This is awesome @CBroz1!! Thanks so much for this contribution — a great improvement! Indeed the failing tests are not your fault, so I vote we merge. May I merge it in now, or do you have anything else you want to add first?

CBroz1 commented 1 year ago

This is awesome @CBroz1!! Thanks so much for this contribution — a great improvement! Indeed the failing tests are not your fault, so I vote we merge. May I merge it in now, or do you have anything else you want to add first?

Happy to help! No, I have no other planned additions. Feel free to merge