You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but I doubt any of us would prefer it. I think the two biggest advantages of the constants are:
Preventing typos
Allowing us to change the names
Of these, 2 seems unlikely to be important (and we'll probably not use the constants in examples/documentation anyhow) and 1 might eventually be solved with things like python/typing#28 (comment) and pydata/xarray#3967. I'm not going to hold my breath for that, but I do think it's worth asking whether or not we would all prefer this instead:
As a user, I think I would be happy to make my own constants or use mypy Literal types if I wanted some static safety and to just live with the risk of typos otherwise. As a contributor, I'm not so sure but I'm leaning towards preferring the latter. Any thoughts?
The text was updated successfully, but these errors were encountered:
Can we live without constants for dimension names in datasets (cf. https://github.com/pystatgen/sgkit/pull/10)?
Specifically I mean these in
api.py
:Using these to build/append a dataset involves something like this:
What I'm wondering is if we're going to use constants, why stop at the dimension names? It could look like this:
but I doubt any of us would prefer it. I think the two biggest advantages of the constants are:
Of these, 2 seems unlikely to be important (and we'll probably not use the constants in examples/documentation anyhow) and 1 might eventually be solved with things like python/typing#28 (comment) and pydata/xarray#3967. I'm not going to hold my breath for that, but I do think it's worth asking whether or not we would all prefer this instead:
As a user, I think I would be happy to make my own constants or use mypy Literal types if I wanted some static safety and to just live with the risk of typos otherwise. As a contributor, I'm not so sure but I'm leaning towards preferring the latter. Any thoughts?
The text was updated successfully, but these errors were encountered: