scipp / sciline

Build scientific pipelines for your data
https://scipp.github.io/sciline/
BSD 3-Clause "New" or "Revised" License
10 stars 2 forks source link

Implement ADR 0002 (remove special handling of Optional and Union) #158

Closed SimonHeybrock closed 7 months ago

SimonHeybrock commented 7 months ago

While Pipeline will be re-implemented, I nevertheless made this change, since it allows for updating units tests with new expected behavior, which will make the re-implementation easier/smaller (will pass the same unit tests), decoupling the behavior change from the re-implementation.

MridulS commented 7 months ago

We should probably change https://github.com/scipp/sciline/blob/5a8bdd95d10c593f9cd6dabca7ee425abdc971ee/src/sciline/pipeline.py#L358 to Optional[Dict[Any, Any]] maybe with a comment about the weird behaviour of what is a type vs type hint?

SimonHeybrock commented 7 months ago

I am thinking now that we should remove the object hints, and disable mypy warnings on a case-by-case basis where Optional is used. It seems either we need a fundamentally new idea how to handle Optional, or just avoid it entirely?