-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to the new takane specification (#1)
* Save and Load Summarized and RangedSummarized Experiments * Export common utils for reuse in SE derivatives * Update tests, documentation and github actions
- Loading branch information
Showing
15 changed files
with
550 additions
and
327 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Publish to PyPI | ||
|
||
on: | ||
|
@@ -6,32 +9,43 @@ on: | |
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest tox | ||
pip install flake8 pytest tox | ||
# - name: Lint with flake8 | ||
# run: | | ||
# # stop the build if there are Python syntax errors or undefined names | ||
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
# # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with tox | ||
run: | | ||
tox | ||
- name: Build package | ||
- name: Build docs | ||
run: | | ||
tox -e docs | ||
- run: touch ./docs/_build/html/.nojekyll | ||
- name: GH Pages Deployment | ||
uses: JamesIves/[email protected] | ||
with: | ||
branch: gh-pages # The branch the action should deploy to. | ||
folder: ./docs/_build/html | ||
clean: true # Automatically remove deleted files from the deploy branch | ||
- name: Build Project and Publish | ||
run: | | ||
python -m tox -e clean,build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_PASSWORD }} | ||
password: ${{ secrets.PYPI_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,17 +5,17 @@ | |
|
||
[metadata] | ||
name = dolomite-se | ||
description = Add a short description here! | ||
description = Save and load summarized experiments in the dolomite framework! | ||
author = LTLA | ||
author_email = [email protected] | ||
license = MIT | ||
license_files = LICENSE.txt | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown; charset=UTF-8; variant=GFM | ||
url = https://github.com/pyscaffold/pyscaffold/ | ||
url = https://github.com/ArtifactDB/dolomite-se | ||
# Add here related links, for example: | ||
project_urls = | ||
Documentation = https://pyscaffold.org/ | ||
Documentation = https://github.com/ArtifactDB/dolomite-se | ||
# Source = https://github.com/pyscaffold/pyscaffold/ | ||
# Changelog = https://pyscaffold.org/en/latest/changelog.html | ||
# Tracker = https://github.com/pyscaffold/pyscaffold/issues | ||
|
@@ -41,17 +41,18 @@ package_dir = | |
=src | ||
|
||
# Require a min/specific Python version (comma-separated conditions) | ||
# python_requires = >=3.8 | ||
python_requires = >=3.8 | ||
|
||
# Add here dependencies of your project (line-separated), e.g. requests>=2.2,<3.0. | ||
# Version specifiers like >=2.2,<3.0 avoid problems due to API changes in | ||
# new major versions. This works if the required packages follow Semantic Versioning. | ||
# For more information, check out https://semver.org/. | ||
install_requires = | ||
importlib-metadata; python_version<"3.8" | ||
dolomite_base | ||
dolomite_matrix | ||
summarizedexperiment>=0.3.7 | ||
dolomite_base==0.2.0-alpha6 | ||
dolomite_matrix==0.1.0-alpha3 | ||
dolomite_ranges==0.0.1-alpha2 | ||
summarizedexperiment>=0.4.2,<0.5.0 | ||
|
||
|
||
[options.packages.find] | ||
|
@@ -70,7 +71,6 @@ testing = | |
pytest | ||
pytest-cov | ||
numpy | ||
filebackedarray | ||
|
||
[options.entry_points] | ||
# Add here console scripts like: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import os | ||
|
||
import dolomite_base as dl | ||
from dolomite_base.read_object import read_object_registry | ||
from summarizedexperiment import RangedSummarizedExperiment | ||
|
||
from .utils import read_common_se_props | ||
|
||
read_object_registry[ | ||
"ranged_summarized_experiment" | ||
] = "dolomite_se.read_ranged_summarized_experiment" | ||
|
||
|
||
def read_ranged_summarized_experiment( | ||
path: str, metadata: dict, **kwargs | ||
) -> RangedSummarizedExperiment: | ||
"""Load a | ||
:py:class:`~summarizedexperiment.RangedSummarizedExperiment.RangedSummarizedExperiment` | ||
from its on-disk representation. | ||
This method should generally not be called directly but instead be invoked by | ||
:py:meth:`~dolomite_base.read_object.read_object`. | ||
Args: | ||
path: | ||
Path to the directory containing the object. | ||
metadata: | ||
Metadata for the object. | ||
kwargs: | ||
Further arguments, ignored. | ||
Returns: | ||
A | ||
:py:class:`~summarizedexperiment.RangedSummarizedExperiment.RangedSummarizedExperiment` | ||
with file-backed arrays in the assays. | ||
""" | ||
|
||
_row_data, _column_data, _assays = read_common_se_props(path) | ||
|
||
rse = RangedSummarizedExperiment( | ||
assays=_assays, | ||
row_data=_row_data, | ||
column_data=_column_data, | ||
) | ||
|
||
_meta_path = os.path.join(path, "other_data") | ||
if os.path.exists(_meta_path): | ||
_meta = dl.read_object(_meta_path) | ||
rse = rse.set_metadata(_meta.as_dict()) | ||
|
||
_ranges_path = os.path.join(path, "row_ranges") | ||
if os.path.exists(_ranges_path): | ||
_ranges = dl.read_object(_ranges_path) | ||
rse = rse.set_row_ranges(_ranges) | ||
|
||
return rse |
Oops, something went wrong.