wincowgerDEV / OpenSpecy-package

Analyze, Process, Identify, and Share, Raman and (FT)IR Spectra
http://wincowger.com/OpenSpecy-package/
Creative Commons Attribution 4.0 International
23 stars 11 forks source link

[Bug]: `plotly_spec()` error messages could be more helpful #148

Closed wincowgerDEV closed 9 months ago

wincowgerDEV commented 11 months ago

Guidelines

Project Version

No response

Platform and OS Version

No response

Existing Issues

No response

What happened?

When a zero spectra OpenSpecy object is sent to plotly_spec the error message says intensity not found which isn't super intuitive, could fix in two places, perhaps in the plotly_spec we require more than zero spectra and in the filter we throw a warning that they created a zero order OpenSpecy.

Steps to reproduce

plotly_spec(filter_spec(test_lib, logic = NULL))
Error in eval(expr, data, expr_env) : object 'intensity' not found

Expected behavior

Helpful message

Attachments

No response

Screenshots or Videos

No response

Additional Information

No response

wincowgerDEV commented 9 months ago

I think its actually better in this case just to disallow filtering to zero and produce a helpful error message there. I don't know of a case where a zero spectra open specy object should be allowed or would be useful.

wincowgerDEV commented 9 months ago

https://github.com/wincowgerDEV/OpenSpecy-package/pull/157/commits/21853449726ceedade390ab7afc7d9a718325b4c