G
YouTube TikTok Games
Skip to content

Typing issues #67

Open
Open

Description

@vld-codra

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions