Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DiseasyModel #36

Merged
merged 21 commits into from
Jul 12, 2024
Merged

DiseasyModel #36

merged 21 commits into from
Jul 12, 2024

Conversation

RasmusSkytte
Copy link
Contributor

@RasmusSkytte RasmusSkytte commented Oct 9, 2023

Intent

This PR adds the DiseasyModel class (fixing #26)

Approach

Exported from NGC and adapted.

This class (now fully documented) forms the basis for all model templates in diseasy.

To do this, it includes the ability to contain instances of functional modules (presently, DiseasySeason, DiseasyActivity and DiseasyObservables).

These can be added either in the constructor of through the $load_module() function (implemented in DiseasyBaseModule not DiseasyModel).

Beyond containing these instances of functional modules, DiseasyModel defines the "API" for the model templates to use.
That is, it provides the functions:

  • $get_results()
  • $get_training_data()

and it implements the $parameters list of parameters for the model.

The implementation of $load_module() in DiseasyBaseModule is also refactored and generalized to load arbitrary modules and not just DiseasyObservables.
Now, if any class includes the private field $.Diseasy<Module> then $load_module() can populate this field if the provided module has the class "<Module>" (e.g. DiseasyObservables).

Known issues

The tests for DiseasySeason and DiseasyObservables are failing.
This is due to the tests being run across all diseasystores which as introduced errors.
This is being fixed in a different PR:

The R-CMD-Check without dependencies is failing.
This is being fixed in a different PR

We may want to wait for #101 and #111 to be merged before merging this PR.
This way, we can add these new functional modules to DiseasyModel.

Checklist

  • The PR passes all local unit tests
  • I have documented any new features introduced
  • If the PR adds a new feature, please add an entry in NEWS.md
  • A reviewer is assigned to this PR

@codecov
Copy link

codecov bot commented Oct 9, 2023

Codecov Report

Attention: Patch coverage is 61.36364% with 17 lines in your changes missing coverage. Please review.

Project coverage is 85.79%. Comparing base (0e01449) to head (d5fa480).
Report is 29 commits behind head on main.

Current head d5fa480 differs from pull request most recent head 0b866fd

Please upload reports for the commit 0b866fd to get more accurate results.

Files Patch % Lines
R/DiseasyModel.R 61.36% 17 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #36      +/-   ##
==========================================
- Coverage   87.19%   85.79%   -1.41%     
==========================================
  Files           8        9       +1     
  Lines         914      929      +15     
==========================================
  Hits          797      797              
- Misses        117      132      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RasmusSkytte RasmusSkytte self-assigned this Oct 9, 2023
@RasmusSkytte RasmusSkytte added this to the v0.1 milestone Oct 9, 2023
@RasmusSkytte RasmusSkytte linked an issue Oct 9, 2023 that may be closed by this pull request
@RasmusSkytte RasmusSkytte modified the milestones: v0.1, v0.2 Dec 15, 2023
@RasmusSkytte RasmusSkytte force-pushed the DiseasyModel branch 3 times, most recently from 5de7bd2 to 4a062f4 Compare May 30, 2024 11:57
@RasmusSkytte RasmusSkytte reopened this Jun 3, 2024
@RasmusSkytte RasmusSkytte added the enhancement New feature or request label Jun 3, 2024
@RasmusSkytte RasmusSkytte marked this pull request as ready for review June 6, 2024 10:59
@RasmusSkytte RasmusSkytte requested review from a team, SofiaOtero and LasseEngboChr and removed request for a team June 6, 2024 10:59
@RasmusSkytte RasmusSkytte changed the title Diseasy model DiseasyModel Jul 5, 2024
R/DiseasyModel.R Outdated Show resolved Hide resolved
R/DiseasyModel.R Outdated Show resolved Hide resolved
R/DiseasyModel.R Outdated Show resolved Hide resolved
R/DiseasyModel.R Outdated Show resolved Hide resolved
Copy link
Contributor

@LasseEngboChr LasseEngboChr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a look at suggestions and comments

@RasmusSkytte RasmusSkytte merged commit 9b5a270 into main Jul 12, 2024
25 checks passed
@RasmusSkytte RasmusSkytte deleted the DiseasyModel branch July 12, 2024 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DiseasyModel
2 participants