Skip to content

Commit

Permalink
ADD: Renaming repos (#5)
Browse files Browse the repository at this point in the history
* renaming repos

* hide codecov for now

* hide codecov for now
  • Loading branch information
adamovanja authored Dec 15, 2023
1 parent bd8b05e commit 2e43f52
Show file tree
Hide file tree
Showing 30 changed files with 85 additions and 84 deletions.
4 changes: 2 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ branch = True
omit =
*/tests*
*/__init__.py
q2_time/_version.py
q2_ritme/_version.py
versioneer.py

[report]
fail_under = 90
omit =
*/tests*
*/__init__.py
q2_time/_version.py
q2_ritme/_version.py
versioneer.py
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
q2_time/_version.py export-subst
q2_ritme/_version.py export-subst
17 changes: 9 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,23 @@ jobs:
run: |
python -m pip install --upgrade pip
make create-env
conda activate time && make dev && make test-cov
conda activate ritme && make dev && make test-cov
- name: Hack - template coverage output path
run: echo "COV=coverage xml -o $GITHUB_WORKSPACE/coverage.xml" >> $GITHUB_ENV

# # TODO: include this once this is a Q2 plugin and remove above run tests
# - uses: qiime2/action-library-packaging@alpha1
# with:
# package-name: q2-time
# package-name: q2-ritme
# additional-tests: ${{ env.COV }}
# build-target: dev
# library-token: ${{ secrets.LIBRARY_TOKEN }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
# TODO: remove token when repos is public
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
# # TODO: add back codecov once repos renaming is detected correctly
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v3
# with:
# # TODO: remove token when repos is public
# token: ${{ secrets.CODECOV_TOKEN }}
# fail_ci_if_error: true
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include versioneer.py
include q2_time/_version.py
include q2_ritme/_version.py
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ test: all

# todo: adjust coverage threshold once final
test-cov: all
py.test --cov=q2_time --cov-report xml:coverage.xml --cov-fail-under=80
py.test --cov=q2_ritme --cov-report xml:coverage.xml --cov-fail-under=80

install: all
$(PYTHON) setup.py install

create-env: install-req
mamba create -y -n time -c qiime2 -c conda-forge -c bioconda -c defaults $(shell python get_requirements.py ci/recipe/meta.yaml conda)
mamba create -y -n ritme -c qiime2 -c conda-forge -c bioconda -c defaults $(shell python get_requirements.py ci/recipe/meta.yaml conda)

install-req:
@command -v mamba >/dev/null 2>&1 || { echo "Installing mamba..."; conda install -y mamba -n base -c conda-forge; }
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# q2-time
![CI](https://github.com/adamovanja/q2-time/actions/workflows/ci.yml/badge.svg)
[![codecov](https://codecov.io/gh/adamovanja/q2-time/branch/main/graph/badge.svg?token=VQ4D7FXMCB)](https://codecov.io/gh/adamovanja/q2-time)
# q2-ritme
![CI](https://github.com/adamovanja/q2-ritme/actions/workflows/ci.yml/badge.svg)
[![codecov](https://codecov.io/gh/adamovanja/q2-ritme/branch/main/graph/badge.svg?token=VQ4D7FXMCB)](https://codecov.io/gh/adamovanja/q2-ritme)

Longitudinal modeling approaches accounting for high-dimensional, sparse and compositional nature of microbial time-series.

## Setup
<!-- TODO: replace plugin name "q2-time" with something better-->
<!-- TODO: replace plugin name "q2-ritme" with something better-->
To install the required dependencies for this package run:
```shell
make create-env
conda activate time
conda activate ritme
make dev
```

Expand Down
10 changes: 5 additions & 5 deletions ci/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% set version = data.get('version') or 'placehold' %}

package:
name: q2-time
name: q2-ritme
version: {{ version }}

source:
Expand Down Expand Up @@ -44,12 +44,12 @@ test:
- coverage
- pytest-cov
imports:
- q2_time
- qiime2.plugins.time
- q2_ritme
- qiime2.plugins.ritme
commands:
- pytest --cov q2_time --pyargs q2_time
- pytest --cov q2_ritme --pyargs q2_ritme

about:
home: https://github.com/adamovanja/q2-time
home: https://github.com/adamovanja/q2-ritme
license: BSD-3-Clause
license_family: BSD
10 changes: 5 additions & 5 deletions experiments/ma5_tune.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
"import pandas as pd\n",
"from IPython.display import display\n",
"\n",
"from q2_time.process_data import load_n_split_data\n",
"from q2_time.tune_models import run_all_trials\n",
"from q2_time.evaluate_models import get_best_model, get_best_data_processing\n",
"from q2_time.feature_space.transform_features import transform_features\n",
"from q2_time.config import (\n",
"from q2_ritme.process_data import load_n_split_data\n",
"from q2_ritme.tune_models import run_all_trials\n",
"from q2_ritme.evaluate_models import get_best_model, get_best_data_processing\n",
"from q2_ritme.feature_space.transform_features import transform_features\n",
"from q2_ritme.config import (\n",
" HOST_ID,\n",
" TARGET,\n",
" TRAIN_SIZE,\n",
Expand Down
10 changes: 5 additions & 5 deletions experiments/try_tune.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
"import pandas as pd\n",
"from IPython.display import display\n",
"\n",
"from q2_time.process_data import load_n_split_data\n",
"from q2_time.tune_models import run_all_trials\n",
"from q2_time.evaluate_models import get_best_model, get_best_data_processing\n",
"from q2_time.feature_space.transform_features import transform_features\n",
"from q2_time.config import (\n",
"from q2_ritme.process_data import load_n_split_data\n",
"from q2_ritme.tune_models import run_all_trials\n",
"from q2_ritme.evaluate_models import get_best_model, get_best_data_processing\n",
"from q2_ritme.feature_space.transform_features import transform_features\n",
"from q2_ritme.config import (\n",
" HOST_ID,\n",
" TARGET,\n",
" SEED_DATA,\n",
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions q2_time/_version.py → q2_ritme/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def get_config():
cfg.VCS = "git"
cfg.style = "pep440"
cfg.tag_prefix = ""
cfg.parentdir_prefix = "q2-time-"
cfg.versionfile_source = "q2_time/_version.py"
cfg.parentdir_prefix = "q2-ritme-"
cfg.versionfile_source = "q2_ritme/_version.py"
cfg.verbose = False
return cfg

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from q2_time.feature_space.transform_features import transform_features
from q2_time.process_data import split_data_by_host
from q2_ritme.feature_space.transform_features import transform_features
from q2_ritme.process_data import split_data_by_host


def process_train(config, train_val, target, host_id, seed_data):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from sklearn.metrics import mean_squared_error
from tensorflow.keras import layers, models, optimizers

from q2_time.feature_space._process_train import process_train
from q2_ritme.feature_space._process_train import process_train


def _predict_rmse(model: BaseEstimator, X: np.ndarray, y: np.ndarray) -> float:
Expand Down
10 changes: 5 additions & 5 deletions q2_time/plugin_setup.py → q2_ritme/plugin_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

from qiime2.plugin import Citations, Plugin

from q2_time import __version__
from q2_ritme import __version__

citations = Citations.load("citations.bib", package="q2_time")
citations = Citations.load("citations.bib", package="q2_ritme")

plugin = Plugin(
name="time",
name="ritme",
version=__version__,
website="https://github.com/adamovanja/q2-time",
package="q2_time",
website="https://github.com/adamovanja/q2-ritme",
package="q2_ritme",
description="This is a QIIME 2 plugin for longitudinal modeling applied to "
"microbial time-series.",
short_description="",
Expand Down
4 changes: 2 additions & 2 deletions q2_time/process_data.py → q2_ritme/process_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from sklearn.model_selection import GroupShuffleSplit

# todo: adjust to json file to be read in from user
from q2_time.config import HOST_ID, SEED_DATA, TARGET, TRAIN_SIZE
from q2_time.simulate_data import simulate_data
from q2_ritme.config import HOST_ID, SEED_DATA, TARGET, TRAIN_SIZE
from q2_ritme.simulate_data import simulate_data


def load_data(path2md: str = None, path2ft: str = None) -> (pd.DataFrame, pd.DataFrame):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
from scipy.stats.mstats import gmean
from skbio.stats.composition import ilr

from q2_time.feature_space._process_train import process_train
from q2_time.feature_space.transform_features import (
from q2_ritme.feature_space._process_train import process_train
from q2_ritme.feature_space.transform_features import (
PSEUDOCOUNT,
alr,
transform_features,
)


class TestTransformFeatures(TestPluginBase):
package = "q2_time.test"
package = "q2_ritme.test"

def setUp(self):
super().setUp()
Expand Down Expand Up @@ -119,7 +119,7 @@ def test_transform_features_error(self):


class TestProcessTrain(TestPluginBase):
package = "q2_time.test"
package = "q2_ritme.test"

def setUp(self):
super().setUp()
Expand All @@ -144,8 +144,8 @@ def _assert_called_with_df(self, mock, expected_df, *expected_args):
for expected, actual in zip(expected_args, args[1:]):
assert expected == actual, f"Expected {expected}, but got {actual}"

@patch("q2_time.feature_space._process_train.transform_features")
@patch("q2_time.feature_space._process_train.split_data_by_host")
@patch("q2_ritme.feature_space._process_train.transform_features")
@patch("q2_ritme.feature_space._process_train.split_data_by_host")
def test_process_train(self, mock_split_data_by_host, mock_transform_features):
# Arrange
ls_ft = ["F0", "F1"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pandas.testing import assert_frame_equal
from qiime2.plugin.testing import TestPluginBase

from q2_time.process_data import (
from q2_ritme.process_data import (
filter_merge_n_sort,
load_data,
load_n_split_data,
Expand All @@ -15,7 +15,7 @@


class TestProcessData(TestPluginBase):
package = "q2_time.test"
package = "q2_ritme.test"

def setUp(self):
super().setUp()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from pandas.testing import assert_frame_equal
from qiime2.plugin.testing import TestPluginBase

from q2_time.simulate_data import simulate_feature_table, simulate_metadata
from q2_ritme.simulate_data import simulate_feature_table, simulate_metadata


class TestFeatureTableSimulation(TestPluginBase):
"""Test all related to simulate_feature_table"""

package = "q2_time.tests"
package = "q2_ritme.tests"

def test_default_feature_table(self):
"""Test default functionality"""
Expand Down Expand Up @@ -40,7 +40,7 @@ def test_randomness(self):
class TestMetadataSimulation(TestPluginBase):
"""Test all related to simulate_metadata"""

package = "q2_time.tests"
package = "q2_ritme.tests"

def setUp(self):
super().setUp()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from qiime2.plugin.testing import TestPluginBase

from q2_time.model_space import _static_searchspace as ss
from q2_ritme.model_space import _static_searchspace as ss


class TestStaticSearchSpace(TestPluginBase):
"""Test all static search space dictionaries"""

package = "q2_time.tests"
package = "q2_ritme.tests"

def setUp(self):
super().setUp()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error

from q2_time.model_space import _static_trainables as st
from q2_ritme.model_space import _static_trainables as st


class TestHelperFunctions(TestPluginBase):
"""Test all related to helper functions used by static_trainables"""

package = "q2_time.tests"
package = "q2_ritme.tests"

def setUp(self):
super().setUp()
Expand Down Expand Up @@ -46,7 +46,7 @@ def test_report_results_manually(self, mock_get_trial_dir, mock_report):


class TestTrainables(TestPluginBase):
package = "q2_time.tests"
package = "q2_ritme.tests"

def setUp(self):
super().setUp()
Expand All @@ -64,9 +64,9 @@ def setUp(self):
self.seed_data = 0
self.seed_model = 0

@patch("q2_time.model_space._static_trainables.process_train")
@patch("q2_time.model_space._static_trainables.LinearRegression")
@patch("q2_time.model_space._static_trainables._report_results_manually")
@patch("q2_ritme.model_space._static_trainables.process_train")
@patch("q2_ritme.model_space._static_trainables.LinearRegression")
@patch("q2_ritme.model_space._static_trainables._report_results_manually")
def test_train_linreg(self, mock_report, mock_linreg, mock_process_train):
# define input parameters
config = {"fit_intercept": True}
Expand All @@ -92,9 +92,9 @@ def test_train_linreg(self, mock_report, mock_linreg, mock_process_train):
mock_linreg_instance.fit.assert_called_once()
mock_report.assert_called_once()

@patch("q2_time.model_space._static_trainables.process_train")
@patch("q2_time.model_space._static_trainables.RandomForestRegressor")
@patch("q2_time.model_space._static_trainables._report_results_manually")
@patch("q2_ritme.model_space._static_trainables.process_train")
@patch("q2_ritme.model_space._static_trainables.RandomForestRegressor")
@patch("q2_ritme.model_space._static_trainables._report_results_manually")
def test_train_rf(self, mock_report, mock_rf, mock_process_train):
# Arrange
config = {"n_estimators": 100, "max_depth": 10}
Expand Down Expand Up @@ -122,9 +122,9 @@ def test_train_rf(self, mock_report, mock_rf, mock_process_train):
mock_rf_instance.fit.assert_called_once()
mock_report.assert_called_once()

@patch("q2_time.model_space._static_trainables.process_train")
@patch("q2_time.model_space._static_trainables.models.Sequential")
@patch("q2_time.model_space._static_trainables.k_cc")
@patch("q2_ritme.model_space._static_trainables.process_train")
@patch("q2_ritme.model_space._static_trainables.models.Sequential")
@patch("q2_ritme.model_space._static_trainables.k_cc")
def test_train_nn(self, mock_checkpoint, mock_nn, mock_process_train):
# Arrange
config = {
Expand Down Expand Up @@ -162,10 +162,10 @@ def test_train_nn(self, mock_checkpoint, mock_nn, mock_process_train):
mock_nn_instance.fit.assert_called_once()
mock_checkpoint.assert_called_once()

@patch("q2_time.model_space._static_trainables.process_train")
@patch("q2_time.model_space._static_trainables.xgb.DMatrix")
@patch("q2_time.model_space._static_trainables.xgb.train")
@patch("q2_time.model_space._static_trainables.xgb_cc")
@patch("q2_ritme.model_space._static_trainables.process_train")
@patch("q2_ritme.model_space._static_trainables.xgb.DMatrix")
@patch("q2_ritme.model_space._static_trainables.xgb.train")
@patch("q2_ritme.model_space._static_trainables.xgb_cc")
def test_train_xgb(
self, mock_checkpoint, mock_xgb_train, mock_dmatrix, mock_process_train
):
Expand Down
4 changes: 2 additions & 2 deletions q2_time/tune_models.py → q2_ritme/tune_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from ray.tune.schedulers import AsyncHyperBandScheduler, HyperBandScheduler

# todo: adjust to json file to be read in from user
from q2_time.model_space import _static_searchspace as ss
from q2_time.model_space import _static_trainables as st
from q2_ritme.model_space import _static_searchspace as ss
from q2_ritme.model_space import _static_trainables as st

model_trainables = {
# model_type: trainable
Expand Down
Loading

0 comments on commit 2e43f52

Please sign in to comment.