Skip to content
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

Fix casting to float when assigning numeric values; fixes normalization of integer arrays #837

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

eroell
Copy link
Collaborator

@eroell eroell commented Dec 6, 2024

PR Checklist

Description of changes
Newly, casting adata.X to the dtype of the array it is assigned values from.

Technical details
adata.X being of a dtype which annot be casted to the dtype of values (e.g. object if containing string) should not be a prominent problem, as this will trigger the set_numeric_values earlier during _assert_encoded.

Additional context

@eroell eroell requested a review from Zethson December 6, 2024 11:35
@github-actions github-actions bot added the bug Something isn't working label Dec 6, 2024
Copy link
Member

@Zethson Zethson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Zethson
Copy link
Member

Zethson commented Dec 6, 2024

Resolved 264 packages in 3.18s
  × Failed to download and build `numpy==1.25.2`
  ╰─▶ Build backend failed to determine requirements with `build_wheel()`
      (exit status: 1)

      [stderr]
      Traceback (most recent call last):
        File "<string>", line 8, in <module>
        File
      "/home/docs/.cache/uv/builds-v0/.tmpFdZf6K/lib/python3.12/site-packages/setuptools/__init__.py",
      line 10, in <module>
          import distutils.core
      ModuleNotFoundError: No module named 'distutils'

      hint: `distutils` was removed from the standard library in Python 3.12.
      Consider adding a constraint (like `numpy >1.25.2`) to avoid building a
      version of `numpy` that depends on `distutils`.
  help: `numpy` (v1.25.2) was included because `ehrapy` (v0.11.0) depends on
        `lifelines` (v0.30.0) which depends on `numpy`

Why the heck is this happening now again. Sigh...

@Zethson Zethson merged commit 27852fa into main Dec 6, 2024
13 of 15 checks passed
@Zethson Zethson deleted the fix/normalization-of-integers branch December 6, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scaling integer array does not cast to float
2 participants