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

Test OpenCPU wrapper with webhook #39

Merged
merged 111 commits into from
Feb 22, 2021
Merged

Test OpenCPU wrapper with webhook #39

merged 111 commits into from
Feb 22, 2021

Conversation

mrustl
Copy link
Member

@mrustl mrustl commented Feb 5, 2021

This change is Reviewable

hsonne and others added 30 commits May 24, 2019 15:52
Keep list structure by using single brackets
"[" instead of double brackets "[["

Do not use return() in simulate_exposure()
Improve indentation in simulate_risk()
The position of the debug argument was wrong
and referred to the argument "wide"!
(i.e. if wide is FALSE). Nothing else is used
by simulate_risk() that is the only function
that calls simulate_treatment()
Return the most reduced version of the result
list if minimal = TRUE.
- use helper variables "treatment_required",
  "pathogen_required", "isvalue_column"
- rename "cond" to "condition"
- use seq_len(n) instead of 1:n
- improve indentation
- return early with minimal list if
  minimal = TRUE
- no need for "lookup_treatmentNames" and
  "treatment_paras" if minimal = TRUE
Calculate rowSums() out of if/else and store
the result in "event_row_sums"

Use stats::setNames() to set column names at
the end of the function
Extract the calculation of data frames
"treatment_events" and "treatment_paras" into a
new function get_treatment_data_frames()
that returns a list containing these two data
frames
Do not ask for "paras" if minimal is TRUE.
Initialise treatment_events with NULL. No more
need to ask for i == 1 since rbind(NULL, x)
does not fail any more (since some R version...)
- rename "treatement_tmp" to "treatment"
- rename "treatment_tmp_random" to
  "random_values"
- remove bug that was introduced by renaming
- simplify names: "events", "paras" instead of
  "treatment_events", "treatment_paras"
- no need for if/else since rbind.fill() also
  accepts NULL (as "paras" is now initialised
  with) as the first argument
- rename arg "events" to "n_events" in order
  not to conflict with the new variable
  "events"
Also rename arg "treatment_processes_simulate"
to "processes"
This prepares for the replacement of the for-
loops with lapply() in the next step.
- rename get_treatment_data_frames() to
  get_treatment_data()
- avoid intermediate variable "paras", just put
  the lapply()-three-liner directly into the
  list()-call.
- print_step()
- print_repeatings_exposures()
- print_pathogens()

Improve indentation
- simulate_treatment_lean() now returns the events
  data frame itself, not being part of a list
- simulate_risk_lean() now returns a list with
  elements "events" and "total" instead of a list
  of lists
- move print functions to new file "print.R"
- create new function to provide error texts:
  get_stop_text()
- do not use return()
- simplify names
- initialise result data frames with NULL -> rbind
  hand handle this, no need to check for first run
- Use inline helper functions: debug_formatted(),
  distibution_text()
- use new helper functions paras_data_frame(),
  event_data_frame()
…o smart-control

# Conflicts:
#	R/datasets.R
#	man/config_json.Rd
…o smart-control

# Conflicts:
#	R/datasets.R
#	man/config_json.Rd
instead of JSON (same approach as used for kwb.heatsine.opencpu)
to do:
ask @rabbl if:
* email is ok (gmail or TUD?)
* ORCID exists?
delete empty space
…o smart-control

# Conflicts:
#	DESCRIPTION
Smart control: add OpenCPU wrappers for TUD
by using kwb.pkgbuild::deploy_to_branch_with_extra_files()
Add default config by @chsprenger and update docu
in order to stay within GitHubs (<100MB per file limit)
@mrustl mrustl requested a review from hsonne February 5, 2021 12:23
@mrustl mrustl self-assigned this Feb 5, 2021
@mrustl mrustl added this to the v0.3.0 milestone Feb 5, 2021
@mrustl
Copy link
Member Author

mrustl commented Feb 22, 2021

For testing OpenCPU webhook

  1. Go to: https://cloud.opencpu.org/ocpu/test/
  2. Select POST and enter as endpoint https://kwb-r.ocpu.io/kwb.qmra/R/opencpu_simulate_risk/json

grafik

@mrustl mrustl changed the title Prepare release v0.3.0 Test OpenCPU wrapper with webhook Feb 22, 2021
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.

code-refactoring: new "input" structure (due to new columns in "default")
2 participants