angelolab / Nimbus

Other
12 stars 1 forks source link

GitHub Actions #55

Closed srivarra closed 1 year ago

srivarra commented 1 year ago

If you haven't already, please read through our contributing guidelines before opening your PR

What is the purpose of this PR?

Adds GitHub Actions, and adjusts the project to a src layout.

How did you implement your changes

GitHub Actions + src layout

Adds GitHub Actions. Adjusts the structure of the repo, moves all tests to a test directory. Uses the src/package layout.

Here is the new structure of the repo.

.
├── configs
│  ├── decidua_split.json
│  ├── msk_colon_split.json
│  ├── params.toml
│  └── tonic_split.json
├── conftest.py
├── LICENSE
├── pyproject.toml
├── README.md
├── src
│  └── cell_classification
│     ├── __init__.py
│     ├── application.py
│     ├── augmentation_pipeline.py
│     ├── evaluation_script.py
│     ├── loss.py
│     ├── metrics.py
│     ├── model_builder.py
│     ├── plot_utils.py
│     ├── post_processing.py
│     ├── prepare_data_script_decidua.py
│     ├── prepare_data_script_MSK_colon.py
│     ├── prepare_data_script_MSK_pancreas.py
│     ├── prepare_data_script_tonic.py
│     ├── prepare_data_script_tonic_annotated.py
│     ├── promix_naive.py
│     ├── segmentation_data_prep.py
│     ├── semantic_head.py
│     └── simple_data_prep.py
├── tests
│  ├── __init__.py
│  ├── application_test.py
│  ├── augmentation_pipeline_test.py
│  ├── loss_test.py
│  ├── metrics_test.py
│  ├── model_builder_test.py
│  ├── plot_utils_test.py
│  ├── post_processing_test.py
│  ├── promix_naive_test.py
│  ├── segmentation_data_prep_test.py
│  └── simple_data_prep_test.py
└── tox.ini

Testing

Added a fixture for loading in the params.toml file in conftest.py, so we don't need to load it in per test, just pass the fixture's name for any test which needs it.

def test_function_that_uses_params_toml(config_params):
    config_params["key"] = "value"
    ...

You can install the testing dependencies with pip install .[test].

Remaining issues

Currently due to DeepCell's strict TF 2.8 dependency, we cannot test this on non x86_64 machines (i.e. no Apple Silicon). Apple Silicon support requires the usage of specific Conda environments (see here), and is not pip installable.

Misc Notes

JLrumberger commented 1 year ago

@srivarra the PR looks good I'd say. What's with the CI/Upload Coverage action?

srivarra commented 1 year ago

@JLrumberger I'm not too sure, it says that there is nothing to report which is super odd, as this is the same setup we use for many of our other repos. I'll try uploading the coverage directly after running the tests.

I've tried that, and it is possibly because the workflow isn't in the main branch yet, see here.