-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return nothing for getter methods that are not supported #217
Conversation
Great that everything is documented here. I would have said the opposite now 😄 |
What would you suggest now? |
I'm still fine with your solution, don't worry 😉 |
I am happy to hear that but this was not why I asked. Going through the comments and the code again let met realize that I was against using |
This is truly awesome @ueliwechsler, thanks for the contribution. Concerning the related issue #180, we will have to add constructors that work with some unspecified fields. (I don't mind if we do this at the level of the |
From the perspective of the ReachabilityAnalysis API, I think that being able to specify an |
I think I just got more used to undefined methods. But I still agree that for a new user, having a default definition is nicer. Since |
I am again playing around with the |
Yes, we can handle that easily by making a new dispatch on structs with a In fact after parsing the user input, (linear) reachability algorithms normalize systems to only |
There could be a way to get an error too function well_chosen_function_name(func::Function, system, args...)
ret = func(system, args...)
if ret === nothing
error("$func is not implemented by $(typeof(system)).")
end
return ret
end So if someone is sure that |
As = [a][:,:]; Bs = [b][:,:]; Cs = [c]; Ds = [d][:,:]; Es = [e][:,:] | ||
|
||
|
||
|
||
@testset "Continuous identity system" begin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I learned something new here (doc): You can nest @testset
s! In case of no error, it will just print the outer test sets. In case of an error, it will print the inner test sets as well. I just wanted to share this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review!
Yes, the nesting is nice, it makes the testing output so much neater.
Merging.. |
closes #200
Following the proposal of @schillic, I implemented a default case for all getters that returns
nothing
if the method is not implemented. Additionally, I tried to give the unit tests for discrete and continuous systems more structure (which resulted in a large PR...sorry 😁)As a by-product, I also added the supertype
AbstractSystem
to theSystemWithOutput
type.