Primal trait#131
Open
FireNameFN wants to merge 6 commits into
Open
Conversation
FireNameFN
commented
Jul 12, 2026
| fn scalar_of(&mut self, path: &str, value: impl Plottable) -> Result<(), VizError> { | ||
| self.scalar(path, value.to_plot_f64()) | ||
| /// Logs any [`Primal`] scalar without an explicit `to_f64`. | ||
| fn scalar_of(&mut self, path: &str, value: impl Primal) -> Result<(), VizError> { |
Author
There was a problem hiding this comment.
Maybe
Suggested change
| fn scalar_of(&mut self, path: &str, value: impl Primal) -> Result<(), VizError> { | |
| fn scalar_of(&mut self, path: &str, value: &impl Primal) -> Result<(), VizError> { |
But I don't know about compatibility.
Collaborator
There was a problem hiding this comment.
Keep impl Primal (by value). to_f64 already takes &self, so this is compatible with how callers used Plottable, no need to change it.
Owner
|
@rtmongold could you take the first pass on reviewing? |
Collaborator
|
Thanks @FireNameFN for the first contribution —welcome! I left a review with a few fixes that need to be applied. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
What:
Implemented Primal trait as requested in #123. Description copied from Plottable. Tests are questionable. Implementations of Primal trait are in primal module.
Why:
I got bored so contributed to Open Source.
Closes #123
Checklist
## [Unreleased](required for behavior-facing changes)cargo test+cargo clippy --all-targetsclean locallyunwrap/expect/panicon library paths (typed errors instead)