David Peter

Results 1367 comments of David Peter

> Hi! 👋 I co-maintain [trapd00r/LS_COLORS](https://github.com/trapd00r/LS_COLORS). Hi, This project was a huge inspiration for vivid — thank you for still maintaining it! > However, we have more extensions categorized! Would...

> To address that, would you be open to moving vivid into a github org and/or accepting co-maintainers? Yes, absolutely. Sorry for the late reply. I sent an invite.

Thank you for reporting this. Another related issue is https://github.com/sharkdp/numbat/issues/116, which proposes something that would also solve your use cases, I think.

How would you design this feature? If someone types `2meV -> THz`, we currently show a type error (lhs: Energy, rhs: Frequency). Numbat *can* infer that a factor of type...

> This is a bit annoying since currently there is no difference between Hz and rad/s, which imo there should be a 2*pi. If you are interested in the background,...

I have just pushed two changes to Numbat, one [bugfix](https://github.com/sharkdp/numbat/pull/691) and one new function [`quantity_cast`](https://github.com/sharkdp/numbat/pull/692) (docs [here](https://numbat.dev/doc/list-functions-other.html?highlight=quantity_cast#quantity_cast)), which allows us to write generic conversion functions like the following (in Numbat...

You can play with this online [here](https://numbat.dev/?q=fn+magic_energy%3CD%3A+Dim%3E%28q%3A+D%29+-%3E+Energy+%3D%0A++++if+is_zero%28q%29%0A++++++then+0%0A++++else+if+is_dimensionless%28q+%2F+K%29++%23+q+is+a+temperature%3A+E+%3D+k_B+T%0A++++++then+k_B+quantity_cast%28q%2C+K%29%0A++++else+if+is_dimensionless%28q+%2F+m%29++%23+q+is+a+wavelength%3A+E+%3D+%E2%84%8E+c+%2F+%CE%BB%0A++++++then+%E2%84%8E+c+%2F+quantity_cast%28q%2C+m%29%0A++++else+if+is_dimensionless%28q+%2F+g%29++%23+q+is+a+mass%3A+E+%3D+m+c%C2%B2%0A++++++then+quantity_cast%28q%2C+g%29+*+c%C2%B2%0A++++else+if+is_dimensionless%28q+%2F+%28cal%2Fmol%29%29++%23+q+is+energy+per+mole%3A+E+%3D+q+%2F+N_A%0A++++++then+quantity_cast%28q%2C+cal%2Fmol%29+%2F+N_A%0A++++else+error%28%22magic_energy%3A+Cannot+convert+quantity+of+unit+%27%7Bunit_name%28q%29%7D%27+to+an+energy%22%29%E2%8F%8E).

Thank you for reporting this. I can't reproduce this (not a macOS user). We have never seen any reports of invalid LS_COLORS values, but it's certainly an option. It does...

> For CLI usage, I wonder if we could hook it up to ratatui's canvas or [chart](https://github.com/ratatui-org/ratatui/tree/main/examples#chart) widgets. This probably wouldn't be all that useful in practice, but might be...

This changeset now uses plotly, which allows us to open interactive plots in the browser. This is also much lighter in terms of dependencies (but see https://github.com/plotly/plotly.rs/issues/176). And it would...