natverse / nat

NeuroAnatomy Toolbox: An R package for the (3D) visualisation and analysis of biological image data, especially tracings of single neurons.
https://natverse.org/nat/
62 stars 26 forks source link

ngraph operations inform when not a neuron is passed as an argument #506

Closed dokato closed 1 year ago

dokato commented 1 year ago

This PR addresses the following problem (as reported by YJ on Salck)

> n <- fafbseg:::read_l2skel("720575940630111628")
> prune_strahler(n, orderstoprune = 1)
Error in value[[3L]](cond) : 
  No points left after pruning. Consider lowering orders to prune!

But prune_strahler(n[[1]], orderstoprune = 1) works.

I suggest we make the error more explicit, i.e.:

> strahler_order(n)
 Error in .verify_input_neuron(x) : 
Sorry, this function works only on `neuron` objects. Use `nlapply` to iterate over a neuronlist.

I rebuilt the docs too.

jefferis commented 1 year ago

Thanks a lot @dokato! This sounds like a good idea. However unfortunately some of the man files did not get built properly/were deleted for some reason and this is now triggering a check error. Could you see why?

codecov[bot] commented 1 year ago

Codecov Report

Merging #506 (7793673) into master (46e4626) will increase coverage by 0.01%. The diff coverage is 88.88%.

@@            Coverage Diff             @@
##           master     #506      +/-   ##
==========================================
+ Coverage   76.90%   76.92%   +0.01%     
==========================================
  Files          48       48              
  Lines        5906     5915       +9     
==========================================
+ Hits         4542     4550       +8     
- Misses       1364     1365       +1     
Impacted Files Coverage Δ
R/im3d.R 78.80% <ø> (ø)
R/neuron-io-neuroml.R 89.76% <ø> (ø)
R/nrrd-io.R 85.88% <ø> (ø)
R/ngraph.R 87.69% <88.88%> (+0.05%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

dokato commented 1 year ago

Argh, checks complained about some urls, I didn't want to play with that, so meant to rebase them, not remove them. I figured now that it'll be easier if I fix them now, though. Now checks go through.