-
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
Add CroppedSource #220
base: master
Are you sure you want to change the base?
Add CroppedSource #220
Conversation
@NicoKiaru |
We can have probably a static function which does the same using empty source and resampler. The problem with CroppedSource, is that it's not serializable currently, and I want to have all kinds of sources serializable in the playground. Both EmptySource and ResampledSource are serialiazable, while CroppedSource, which as far as I understand is one of them with less flexibility, is not. We could make it serializable, but why would we want to do that ? |
Why is CroppedSource not serializable? |
Did you try it ? There are some serialization tests in the state saver and loader. You can add your cropped source demo and see if it works. Maybe it is working. |
I think it should be working because I could make it such that the only fields of the CroppedSource class are:
The Right now however it does not work, because in the
And of course here is no specific adapter for However, as pointed out above, I don't think we need a specific adapter for Can one maybe change the code in I think that would be very cool in order not to have to implement a custom adapter for classes that can be serialized as is. |
Indeed, I think there's a few improvements which can be made on the serialization now that I understand a bit better how it all works... But "circular" dependencies still needs to be handled in a specific way. I still do not understand why you need this cropped source when the resampled source and the empty source can do the same job and already has:
There are also command in biop tools which are using them. For a full support, you will need to modify the inspector, add new commands and actions, modify the way we find the 'root' source recursively. So I fear this will create more complexity, but if you think it's worth it, please merge. Also, you mentioned you were going to try this in MoBie before we would put it in the playground. Was there an issue when trying inside MoBiE ? |
There was no issue, I just thought it's something that would be nice to have in the playground as it falls into the category "Simple reusable class that does something useful with a SourceAndConverter", something were I thought the playground would be a nice place to have it (even if we do not expose it in the Command's UI). And I was not aware of the cool serialization framework that you implemented and that newly added code needs to play well with this. I also must admit I did not use the Otherwise I can also simply put the |
Oki doc, I agree this Empty Source is not straightforward. I'll try to see if there's a convenient way to use it, or if cropped source is the way to go. Cheers |
Hi @NicoKiaru,
Here's my work in progress (not ready to be merged yet, I did not test it).