cbrnr / sleepecg

Sleep stage detection using ECG
BSD 3-Clause "New" or "Revised" License
96 stars 25 forks source link

Fix type errors #105

Closed cbrnr closed 1 year ago

cbrnr commented 2 years ago

Fixes #93.

cbrnr commented 2 years ago

In my opinion, the remaining errors/warnings (when setting "python.analysis.typeCheckingMode": "basic") are useless. These include:

@hofaflo let me know if you think we should address any of the remaining errors (and if so, please show me how).

cbrnr commented 2 years ago

Ima turn off type checking now to stay sane.

hofaflo commented 1 year ago

Pyright will still complain, but I think making mypy happy is enough :)

The mkdocstrings issue is already fixed upstream (mkdocstrings/python#45), so I bumped the dependency. 5e81986 should have worked around this, but for some reason readthedocs ignored the changed path to the configuration file and kept calling mkdocs with --config-file mkdocs.yml instead of --config-file ./mkdocs.yml (see the build log) :shrug:

hofaflo commented 1 year ago

This is ready to merge from my point of view @cbrnr :)

cbrnr commented 1 year ago

@hofaflo, besides my minor comments this looks really good (I've edited my comments so that all questions are in the first comment).

hofaflo commented 1 year ago

Regarding the py.typed file – why is this empty file necessary (what does it do)?

PEP561 says so :shrug:. I'm not totally sure but I assume it tells type checkers (such as mypy) that the package is typed.

And if it is necessary, should it not be included as package_data?

Totally, it is included in the wheels and in the source archive (I guess because its parent directory is listed in MANIFEST.in?).

I think we should add .mypy_cache to .gitignore.

For some reason my VS Code already ignored it so I didn't notice, but sure, I'll add it :D

cbrnr commented 1 year ago

Looks great! Ready to merge?

hofaflo commented 1 year ago

Yes!

cbrnr commented 1 year ago

Thanks @hofaflo!