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: support for numpy 2.0 #220

Merged
merged 3 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: GoogleCloudPlatform/release-please-action@v4.0.2
- uses: googleapis/release-please-action@v4
id: release
with:
release-type: python
Expand Down Expand Up @@ -47,6 +45,26 @@ jobs:
run: |
poetry build --ansi -n

- name: Publish package on PyPI
- uses: actions/upload-artifact@v4
if: ${{ steps.release.outputs.release_created }}
with:
name: dist
path: dist/

upload_pypi:
needs: release
runs-on: ubuntu-latest
if: ${{ needs.release.outputs.release_created }}
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Get artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: dist

- name: Publish package on PyPI
uses: pypa/[email protected]
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ python = ">=3.7.1,<4.0"
importlib-metadata = {version = ">=3.0.0", python = "<3.8"}
cyvcf2 = ">=0.30.4"
matplotlib = ">=3.1.2"
numpy = ">=1.17.3,<2.0"
numpy = ">=1.17.3"
pandas = ">=1.2.0"
pysam = ">=0.15.4"
scikit-learn = ">=0.23.1"
Expand Down
2 changes: 1 addition & 1 deletion trtools/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def GetEntropy(allele_freqs: Dict[Any, float]) -> float:
"""
if not ValidateAlleleFreqs(allele_freqs):
return np.nan
return scipy.stats.entropy(list(x for x in allele_freqs.values()), base=2)
return float(scipy.stats.entropy(list(x for x in allele_freqs.values()), base=2))


def GetMean(allele_freqs):
Expand Down
Loading