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

Refactored codebase #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Refactored codebase #6

wants to merge 1 commit into from

Conversation

liamzebedee
Copy link
Owner

@liamzebedee liamzebedee commented Jun 16, 2020

Here I'm attempting to refactor the codebase. The previous iteration was largely a monolith of two files - the frontend app and the simulation model.

Some details of the refactoring directory structure are in REFACTOR.md.

The model file was extracted into the following:

  • Simulation - containing the functions modelling insulin and glucose release, as well as the discrete timestep simulator
  • InsulinPumpModel - containing the model of the insulin pump's settings, and relevant helpers for parsing it from text
  • BodyMetabolismModel - containing the model of the body's metabolism.
  • event_helpers - helpers for parsing event strings into Event effects, which are passed into the simulation.

The frontend file was refactored into the following:

  • Plotly helpers - for rendering the Plotly graph, and converting between date formats
  • form helpers - this just contains the debouncers
  • compose helper - this is a functional helper, used by frontend and model.

Originally, the goal was to refactor frontend state. During this iteration, I realised that the state was a reasonable contained concern, compared to the rest of the codebase. Hence, the project structure was refactored instead.

@liamzebedee
Copy link
Owner Author

@squishykid I want this on my desk by Monday.

@squishykid
Copy link

(╯°□°)╯︵ ┻━┻

@squishykid
Copy link

Needs more test coverage b4 i can approve

Renamed:
- Model -> Simulation

Extracted:
- FunctionPlots
- InsulinPumpModel
- BodyMetabolismModel
- plotly helpers
- form helpers (debouncers)
- compose helper

New:
- Helpers for parsing events (event_parsing)
@liamzebedee
Copy link
Owner Author

@squishykid can confirm I have been running this system in production and like me it has 9 9's uptime.

@squishykid
Copy link

Declining because it’s getting stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants