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.
@luiztauffer
Here I have implemented the new class method for protocaas processors.
You can see the examples here:
https://github.com/scratchrealm/pc-spike-sorting/blob/main/mountainsort5/main.py
https://github.com/scratchrealm/pc-spike-sorting/blob/main/kilosort3/main.py
https://github.com/scratchrealm/pc-spike-sorting/blob/main/kilosort2_5/main.py
https://github.com/scratchrealm/pc-spike-sorting/blob/main/dandi_upload/main.py
https://github.com/scratchrealm/pc-spike-sorting/blob/main/spike_sorting_utils/main.py
The tricky part was getting the meta information about the processor context from the type hints, etc. That is done here:
https://github.com/scratchrealm/protocaas/blob/1a5134ebbc1e8673c2de44a3b32740e28ddbb024/python/protocaas/sdk/AppProcessor.py#L169-L268
https://github.com/scratchrealm/protocaas/blob/1a5134ebbc1e8673c2de44a3b32740e28ddbb024/python/protocaas/sdk/_get_context_attributes_for_dataclass.py#L1-L32
Unfortunately, inspecting of type hints did not work with your method of dynamically importing the main.py module, so I had to revert to calling main.py with the SPEC_OUTPUT_FILE env var. However, the CLI works the same as you had it, for example
(also, sprinkled into this PR, are some improvements/simplifications to the mock system for testing)