-
Notifications
You must be signed in to change notification settings - Fork 177
Allow xarray Datasets to be used for obs/var/obsm/varm #1966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4479b94
098beb0
8a60353
3ce1624
02c8355
3862745
9592203
1a0b3f9
3eb33bb
801902c
4b7867e
bc88f12
5344e80
80563bb
938f0b3
01386a4
ff21784
522d679
8e5d122
d00b7a0
bb41f0a
d7f3b40
8e501fb
07b63d0
6cbbaf8
e63a17f
881a46e
efba502
0f506f2
6998f23
d6b8f7f
4a8c4fc
9235625
f1f0d6e
8c34999
71e378c
e8631a1
dc1805d
98922b2
a235fcb
cce1275
7384e22
c248e5c
f4e332b
caf42c2
97cbacc
01194d9
3a12723
40567aa
6c081c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ def min_dep(req: Requirement) -> Requirement: | |
| ------- | ||
|
|
||
| >>> min_dep(Requirement("numpy>=1.0")) | ||
| <Requirement('numpy==1.0.*')> | ||
| <Requirement('numpy~=1.0.0')> | ||
| >>> min_dep(Requirement("numpy<3.0")) | ||
| <Requirement('numpy<3.0')> | ||
| """ | ||
|
|
@@ -55,7 +55,7 @@ def min_dep(req: Requirement) -> Requirement: | |
| elif spec.operator == "==": | ||
| min_version = Version(spec.version) | ||
|
|
||
| return Requirement(f"{req_name}=={min_version}.*") | ||
| return Requirement(f"{req_name}~={min_version}.0") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Not everything uses semver, especially not Python land. We can discuss this of course, if there’s a good reason to make this change we can make it, I’m just saying that this needs to be motivated. |
||
|
|
||
|
|
||
| def extract_min_deps( | ||
|
|
@@ -64,6 +64,7 @@ def extract_min_deps( | |
| dependencies = deque(dependencies) # We'll be mutating this | ||
| project_name = pyproject["project"]["name"] | ||
|
|
||
| deps = {} | ||
| while len(dependencies) > 0: | ||
| req = dependencies.pop() | ||
|
|
||
|
|
@@ -76,7 +77,11 @@ def extract_min_deps( | |
| extra_deps = pyproject["project"]["optional-dependencies"][extra] | ||
| dependencies += map(Requirement, extra_deps) | ||
| else: | ||
| yield min_dep(req) | ||
| if req.name in deps: | ||
| req.specifier &= deps[req.name].specifier | ||
| req.extras |= deps[req.name].extras | ||
| deps[req.name] = min_dep(req) | ||
| yield from deps.values() | ||
|
|
||
|
|
||
| class Args(argparse.Namespace): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -180,7 +180,7 @@ Types used by the former: | |
| experimental.StorageType | ||
| experimental.backed._lazy_arrays.MaskedArray | ||
| experimental.backed._lazy_arrays.CategoricalArray | ||
| experimental.backed._xarray.Dataset2D | ||
| _core.xarray.Dataset2D | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No public exports should start with an underscore, this should be exported somewhere else. We talked about
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I already had this comment as a pending review but never submitted it :( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, apologies you are 100% right. |
||
| ``` | ||
|
|
||
| (extensions-api)= | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Allow xarray Datasets to be used for obs/var/obsm/varm. {user}`ilia-kats` |
Uh oh!
There was an error while loading. Please reload this page.