Skip to content
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
12 changes: 12 additions & 0 deletions mioflow/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from mioflow.mioflow import MIOFlow, train_mioflow
from mioflow.gaga import (
Autoencoder,
fit_gaga,
train_gaga,
train_gaga_two_phase,
PointCloudDataset,
RowStochasticDataset,
dataloader_from_pc,
train_valid_loader_from_pc,
)
from mioflow.core.datasets import TimeSeriesDataset
14 changes: 4 additions & 10 deletions mioflow/mioflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,10 @@
import torchsde
from tqdm import tqdm

try:
from mioflow.core.models.ode_model import ODEFunc
from mioflow.core.models.sde_model import SDEFunc
from mioflow.core.losses import ot_loss, density_loss, energy_loss
from mioflow.core.datasets import TimeSeriesDataset
except ImportError:
from core.models.ode_model import ODEFunc
from core.models.sde_model import SDEFunc
from core.losses import ot_loss, density_loss, energy_loss
from core.datasets import TimeSeriesDataset
from mioflow.core.models.ode_model import ODEFunc
from mioflow.core.models.sde_model import SDEFunc
from mioflow.core.losses import ot_loss, density_loss, energy_loss
from mioflow.core.datasets import TimeSeriesDataset


class MIOFlow:
Expand Down
66 changes: 32 additions & 34 deletions notebooks/1.01.01-SERGIO-single-trajectory.ipynb

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mioflow"
version = "0.1.12"
version = "0.1.13"
description = "MIOFlow is a Python package for modeling and analyzing single-cell RNA-seq data using optimal flows."
readme = "README.md"
requires-python = ">=3.8"
Expand Down Expand Up @@ -43,8 +43,9 @@ dependencies = [
"torch-geometric>=2.6.1",
]

[tool.setuptools]
packages = ["mioflow"]
[tool.setuptools.packages.find]
where = ["."]
include = ["mioflow*"]

[build-system]
requires = ["setuptools>=61.0", "wheel"]
Expand Down
4 changes: 2 additions & 2 deletions tutorials/01_mioflow_colab.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 24,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -164,7 +164,7 @@
}
],
"source": [
"!pip install pandas==2.2.0 mioflow gdown"
"!pip install pandas mioflow gdown"
]
},
{
Expand Down
20 changes: 5 additions & 15 deletions tutorials/01_mioflow_vanilla.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"%load_ext autoreload\n",
"%autoreload 2\n",
"\n",
"import sys\n",
"import numpy as np\n",
"import pandas as pd\n",
"import scanpy as sc\n",
Expand All @@ -46,9 +45,8 @@
"from sklearn.preprocessing import StandardScaler\n",
"from sklearn.metrics.pairwise import pairwise_distances\n",
"\n",
"sys.path.insert(0, '../MIOFlow')\n",
"from gaga import Autoencoder, train_gaga_two_phase, dataloader_from_pc\n",
"from mioflow import MIOFlow\n"
"from mioflow.gaga import Autoencoder, train_gaga_two_phase, dataloader_from_pc\n",
"from mioflow.mioflow import MIOFlow\n"
]
},
{
Expand Down Expand Up @@ -280,15 +278,7 @@
}
],
"source": [
"import importlib\n",
"\n",
"sys.path.insert(0, '../MIOFlow')\n",
"import mioflow\n",
"# After making changes to my_module:\n",
"importlib.reload(mioflow)\n",
"\n",
"\n",
"mf = mioflow.MIOFlow(\n",
"mf = MIOFlow(\n",
" adata,\n",
" gaga_model=gaga_model,\n",
" gaga_input_scaler=scaler_pca, # fitted on X_pca — used for encode() and inverse_transform()\n",
Expand All @@ -310,7 +300,7 @@
" n_trajectories=100,\n",
" n_bins=100,\n",
" exp_dir='.',\n",
")"
")\n"
]
},
{
Expand Down Expand Up @@ -818,4 +808,4 @@
},
"nbformat": 4,
"nbformat_minor": 5
}
}