-
Notifications
You must be signed in to change notification settings - Fork 6
Labels
code cleanupImprove the quality and documentation of our codeImprove the quality and documentation of our codepart::coreIssues and MRs for the core part of MAICoS.Issues and MRs for the core part of MAICoS.priority::high
Description
In #524 we had to disable the type checking for all modules because the means and sems of the _obs dictionary have no clear types.
We should set these types in a better way and re-enable the checker with mypy. I think the propper way is that each module has to define it's observables and we do not try to guess a complicated try-except block:
maicos/src/maicos/core/base.py
Lines 477 to 491 in b6097db
| # This try/except block is used because it will fail only once and is | |
| # therefore not a performance issue like a if statement would be. | |
| try: | |
| # Fail fast if the means and sems are not defined yet. | |
| self.means # type: ignore # noqa B018 | |
| self.sems # type: ignore # noqa B018 | |
| # Take the data from the current frame and update the means and sems | |
| for key in self._obs: | |
| # Sanitize the data type of the observable | |
| if isinstance(self._obs[key], list): | |
| self._obs[key] = np.array(self._obs[key]) | |
| if key not in self._pop: | |
| # Observable is a single sample, so _pop is 1 and _var is 0 | |
| self._pop[key] = np.ones(np.shape(self._obs[key]), dtype=int) |
Originally posted by @PicoCentauri in #524 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
code cleanupImprove the quality and documentation of our codeImprove the quality and documentation of our codepart::coreIssues and MRs for the core part of MAICoS.Issues and MRs for the core part of MAICoS.priority::high