Closed FantasyTeddy closed 2 years ago
How this is any different from:
static ref STANDARD_NO_IMPL: ReadoutError = ReadoutError::Warning(String::from(
"This metric is not available on this platform or is not yet implemented by macchina."
));
The PR is titled "explicity mark readouts that are not implemented", but by default, any unimplemented functions are going to result in ""This metric is not available on this platform or is not yet implemented by macchina.", which achieves the same goal as what you're trying to do, but with more lines of code. For an end user (developer), there is no noticeable change.
The difference is that my suggestion is 'explicit' while the current implementation is 'implicit'. In the current implementation you have to know which functions any specific readout offers and compare it with the functions that you have actually implemented. You don't see immediately, what functionality is not implemented.
For me these are two different answers to the following question: "When do I want to realize that I forgot to implement a function?"
You don't see immediately, what functionality is not implemented.
Your point is solid, let's see what the others think.
@uttarayan21 @123marvin123
I think this is a good change, I always try to be explicit with errors and seems like this might be useful when debugging readouts.
In the current implementation you have to know which functions any specific readout offers and compare it with the functions that you have actually implemented.
Yeah, resulting in a lot of wasted time.
Great, I will continue working on this, since your feedback seems to be mostly positive.
I have one more question that would make it easier for me: could we make the GitHub Workflow of this repository more like the one in macchina where we test every possible target? This would give me (or any other contributor) more confidence that I didn't screw something up while refactoring.
could we make the GitHub Workflow of this repository more like the one in macchina where we test every possible target?
Sure, I'll make this happen.
You don't see immediately, what functionality is not implemented.
Your point is solid, let's see what the others think.
@uttarayan21 @123marvin123
I think its a good change 👍🏼
If you've noticed, a lot of our documentation is written for implementors, but we've yet to see anybody implement on top of libmacchina, we should write documentation that explains how to use the functions and their expected output.
This is a topic for another day, though.
I noticed that too. For this pull-request I will implement the missing functions in the documentation examples, but I agree that the examples should rather target the users than those that implement readout traits.
Something's up with the crates.io API :(
Yes, apparently they are experiencing an outage.
We should refrain from pushing until they can recover, we don't want to be stressing their servers at this moment.
According to their incident report, the issue should be resolved. Can you trigger the CI pipeline again?
According to their incident report, the issue should be resolved. Can you trigger the CI pipeline again?
Right away ;)
We're set! You've done an outstanding job @FantasyTeddy :heart:
Thank you, glad I can help :)
This is probably a controversial change. The idea behind this is to make it more obvious, which readouts/functions are supported in the corresponding targets.
Advantage: It is easier to determine which functions are implemented for a specific target and what might need to be added in the future.
Disadvantage: It might seem messier to have all those
ReadoutError::NotImplemented
.❗ Important: I did not yet make the change in the entire library and it therefore does not compile yet. I want to gather some feedback if this is even something that would be accepted, before I finish this work.