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

Targets spec #76

Open
wants to merge 4 commits into
base: targets
Choose a base branch
from
Open

Targets spec #76

wants to merge 4 commits into from

Conversation

rvyuha
Copy link
Contributor

@rvyuha rvyuha commented May 4, 2021

Spec and tests for the verification

@rvyuha rvyuha requested a review from yulric May 4, 2021 18:14
@DougManuel DougManuel self-requested a review May 17, 2021 19:21

# Main Export Functions

### Verify Targets
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you the document the list of warnings that this function can output


The order in which modules are ran

# Example function usage
Copy link
Contributor

Choose a reason for hiding this comment

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

This section should be combined with the first section. Each example usage should be moved to the section for that function.

#### Special Arguments

*role* This would search for variables matching the role in variables.csv and be replaced with vecor of var names during run time.
*data* This would pass the object attached to the bllflow object inside the data list ie: bllflow$data[[<whats inside data>]]
Copy link
Contributor

Choose a reason for hiding this comment

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

The data argument can also reference an object created during target execution. For example the second step in the depression imputation module is impute_depression_score. We can reference the result of this step in the next step using, data["impute_depression_scpre"]

Copy link
Contributor

@yulric yulric left a comment

Choose a reason for hiding this comment

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

  1. It looks like you're missing the function that creates a targets list from modules map CSV or a module CSV file
  2. The column header for the CSV file should use the same naming convention as recodeflow (snake case)
  3. The spec should be updated to split the step_arguments column into the columns stepArgumentName and stepArgumentValue
  4. Can you update the spec with the description of the modules map file
  5. I think your tests are too complicated for testing what you want. Don't use the depression imputation module but create simpler module to specifically test what you want.
  6. Can you also add the flow diagram for the verify_targets function?


*role* This would search for variables matching the role in variables.csv and be replaced with vecor of var names during run time.
*data* This would pass the object attached to the bllflow object inside the data list ie: bllflow$data[[<whats inside data>]]
*formula* This would create a left side = right side formula ie: formula[role["outcome"], role["predictor"], sep = "+"] would result in "outcome1 + outcome2 + outcome3 ~ predictor1 + predictor2 + predictor3"
Copy link
Contributor

Choose a reason for hiding this comment

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

How would include terms that are interations and those that are not using this notation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean interactions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because in case of interactions a formula is not needed and you can pass variables as just a vector

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you give an example? Not sure I understand.


The step_id column must contain a unique identifier for the step being performed.

### Step_function
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets make it so that if they do not provide a value for this column, we will just the value in the stepId column as the name of the function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How would we handle multiple identical functions in the same module?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need step function to be the actual function name as thats what would be fed to targets.

Copy link
Contributor

Choose a reason for hiding this comment

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

How would we handle multiple identical functions in the same module?

Since stepId has to be unique this won't be an issue for this feature

I need step function to be the actual function name as thats what would be fed to targets.

The function would have the same name as the value of the stepId if they do not put in a value for the step function column

@@ -0,0 +1,7 @@
Step_ID,Step_function,Step_arguments,Step_description,Step_order
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you update these to be snakeCase like recode flow


The step_arguments column would contain the arguments for the function including our shorthand (roles). I believe we should bring back the roles() and formula notations from previous implementation to avoid any confusion later.

#### Special Arguments
Copy link
Contributor

Choose a reason for hiding this comment

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

One addition would be a vector of values. For example an argument value for a list of survey cycles allowed, ["cchs2001_p", "cchs2003_p"]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would limit where a module can be used, I believe a column like this is best used in modules_map

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure I understand. Can you give an example?

@@ -0,0 +1,2 @@
Module_Name,Module_Path,Module_Description,ModuleOrder
Copy link
Contributor

Choose a reason for hiding this comment

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

The headers should be converted to snakeCase

@rvyuha
Copy link
Contributor Author

rvyuha commented May 25, 2021

  1. It looks like you're missing the function that creates a targets list from modules map CSV or a module CSV fill

1A. Yeah sorry should this be a new function or a modification of any of the functions?

  1. The spec should be updated to split the step_arguments column into the columns stepArgumentName and
    stepArgumentValue

3A. Should we have an individual row per argument?

@yulric
Copy link
Contributor

yulric commented May 26, 2021

  1. It looks like you're missing the function that creates a targets list from modules map CSV or a module CSV fill

1A. Yeah sorry should this be a new function or a modification of any of the functions?

  1. The spec should be updated to split the step_arguments column into the columns stepArgumentName and
    stepArgumentValue

3A. Should we have an individual row per argument?

1A. This should be a new function

3A. Yes, just like the original depression module I made here https://github.com/Big-Life-Lab/huiport/blob/master/worksheets/modules/depression-imputation.csv

…nges in the PR by adding further description of modules_map
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