Skip to content
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

Typing issues #67

Open
7 tasks
vld-codra opened this issue Apr 24, 2024 · 0 comments
Open
7 tasks

Typing issues #67

vld-codra opened this issue Apr 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@vld-codra
Copy link
Contributor

vld-codra commented Apr 24, 2024

This issue will help to track typing issues in Datalab as well as proposals.

Typing errors

  • SignalObj.get_data() returns a tuple[np.ndarray, np.ndarray] and not a single np.ndarray. The signature of the BaseObj.get_data could be modify to allow type changes for child classes
  • Many paramclass arguments/attributes are annotated with MyClass instead of type[MyClass]. eg: in ObjectProp.__init__() or BaseProcessor.init_param().
  • missing types in fitdialogs.py.
  • cdl.core.model.signal.new_signal_param() argument stype takes a string or None but is compatible with SignalTypes members.
  • BaseProcessor.compute_10 my return a typing error if parent function is typed to only return a dict of ResultProperties or ResultShape instead of a union of both. Could be fixed by using a Generic bound to both result types. Therefore, the return type of BaseProcessor.compute_10 would be definded by the return type of the function passed into it.
  • BaseDataPanel.save_to_files() does not have the right typing argument filenames is hinted as str but type not supported inside the method.

Proposals

  • Use generics in base classes that are derived into signal and image classes. eg: in BaseActionHandler, the panel attribute should be a generic that is set to SignalProcessor in SignalActionHandler and vice versa in ImageActionHandler. The same principle could be applied in the BaseProcessor and other.
@vld-codra vld-codra added the bug Something isn't working label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant