carpentries-incubator / carpentries-incubator/python-intermediate-development

Restructure code to improve maintainability

Open
#518 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TeX
Stars
63
Forks
77
Avg merge
20h 8m
Merged PRs (30d)
3

Description

Currently, maintaining or editing the material is a little difficult, as changes in one section carry forward to changes elsewhere. It would help a bit more if the changes in each section were more isolated - so that each section's changes could be implemented as a separate branch, making it easier to do.

The files that are touched are:

1. **Collaborative Development**
- 1.4: `inflammation/models.py`: Minor edit just to demo `git`.
- 1.5: `inflammation-analysis.py`, `inflammation/models.py`: Improving code quality.
- 1.6: `inflammation/models.py`, `inflammation/views.py`: Improving code quality (nonspecific).
2. **Ensuring Correctness**
- 2.1: `tests/test_models.py`: Expanding tests for models.
- 2.4: `tests/test_models.py`, `inflammation/models.py`: Expanding tests, fixing errors in patient normalisation.
3. **Software Development as a Process**
- 3.2. `full-data-analysis` branch: Adds new code for running analysis.
- 3.3: `inflammation/models.py`: Adding new data source.
- 3.3: `inflammation/compute_data.py`, `tests/test_compute_data.py`: Refactoring to class-based load.
- 3.4: `inflammation/compute_data.py`, `test/test_compute_data.py`: Refactor analysis to allow regression testing.
- 3.5: `inflammation/compute_data.py`: Refactoring into MVC model.
4. **Development for Re-Use**
- 4.1: `feature-std-dev` branch: Adds new code for plotting standard deviation.
- 4.1: `inflammation-analysis.py`, `inflammation/models.py`, `test/test_models.py`: Editing the submitted code.
5. **Managing Software**
- Nothing specific.

My proposal would be to replace `inflammation/models.py` with a submodule, `inflammation/models`. Then when we add a new data source, we can do it by only editing one file, e.g. `inflammation/models/csv_data.py`. Likewise, splitting tests into separate files per module. This could be done either by starting with it split up, or splitting it into multiple files as part of section 3.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.