From 555e1e7967d0ba7018cfe4dd126fbcbfafe5d9fa Mon Sep 17 00:00:00 2001 From: "Luke W. Johnston" Date: Tue, 28 Jan 2025 15:38:23 +0100 Subject: [PATCH 1/4] docs: :memo: indicate which functions aren't done yet --- docs/design/interface/python-functions.qmd | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/design/interface/python-functions.qmd b/docs/design/interface/python-functions.qmd index 162b387b3..cb6f86460 100644 --- a/docs/design/interface/python-functions.qmd +++ b/docs/design/interface/python-functions.qmd @@ -144,7 +144,7 @@ function.](images/core/create-resource-properties.svg){#fig-create-resource-prop fig-alt="A Plant UML schematic of the detailed code flow within the `create_resource_properties()` function."} ::: -::: {.callout-note collapse="true"} +::: {.callout-warning collapse="true"} ### `write_resource_data_to_raw(path, data_path)` Copy the file from `data_path` over into the resource location given by @@ -160,7 +160,7 @@ function.](images/core/write-resource-data-to-raw.svg){#fig-write-resource-data- fig-alt="A Plant UML schematic of the detailed code flow within the `write_resource_data_to_raw()` function."} ::: -::: {.callout-note collapse="true"} +::: {.callout-warning collapse="true"} ### `write_resource_parquet(raw_files, path)` This function takes the files provided by `raw_files` and merges them @@ -170,7 +170,7 @@ and `path_resource_raw_files()` for the `raw_files` argument. Outputs the path object of the created file. ::: -::: {.callout-note collapse="true"} +::: {.callout-warning collapse="true"} ### `edit_resource_properties(path, properties)` Edit the properties of a resource in a package. The `properties` @@ -181,7 +181,7 @@ correct path location. Outputs a JSON object only; use `datapackage.json` file. ::: -::: {.callout-note collapse="true"} +::: {.callout-warning collapse="true"} ### `delete_resource_raw_file(path, confirm)` Use this to delete a raw file in the `raw/` folder of a resource. This @@ -194,7 +194,7 @@ to the function argument as confirmation. This is done to prevent accidental deletion. Outputs `true` if the deletion was successful. ::: -::: {.callout-note collapse="true"} +::: {.callout-warning collapse="true"} ### `delete_resource_data(path, confirm)` Delete all data (Parquet) and raw data of a specific @@ -207,7 +207,7 @@ confirmation. This is done to prevent accidental deletion. Outputs properties/metadata for the resource. ::: -::: {.callout-note collapse="true"} +::: {.callout-warning collapse="true"} ### `delete_resource_properties(path, confirm)` Deletes all properties for a resource within the `datapackage.json` @@ -235,7 +235,7 @@ function.](images/core/write-resource-properties.svg){#fig-write-resource-proper fig-alt="A Plant UML schematic of the detailed code flow within the `write_resource_properties()` function."} ::: -::: {.callout-note collapse="true"} +::: {.callout-warning collapse="true"} ### `extract_resource_properties(path, data_path)` This takes the data found at the `data_path` location and creates a JSON @@ -351,7 +351,7 @@ animal, event) that the data was collected on. An example would be: A person in a research study who came to the clinic in May 2024 to have their blood collected and to fill out a survey. -::: {.callout-note collapse="true"} +::: {.callout-warning collapse="true"} ### `delete_participant_data()` TODO. From 77f93d24c6024dae46ec47b8840c8e67e3d4e46a Mon Sep 17 00:00:00 2001 From: "Luke W. Johnston" Date: Tue, 28 Jan 2025 15:38:43 +0100 Subject: [PATCH 2/4] docs: :fire: not sure we need this function --- docs/design/interface/python-functions.qmd | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/docs/design/interface/python-functions.qmd b/docs/design/interface/python-functions.qmd index cb6f86460..603cd430c 100644 --- a/docs/design/interface/python-functions.qmd +++ b/docs/design/interface/python-functions.qmd @@ -332,13 +332,7 @@ outputs a `PackageProperties` object. ## Helper functions -::: {.callout-note collapse="true"} -### `list_files(path)` - -List all files in a directory. Outputs a list of path objects. -::: - -::: {.callout-note collapse="true"} +::: {.callout-warning collapse="true"} ### `pretty_json(json)` Create a prettier, human readable version of a JSON object. From f0c51baf48de335e07a39c6fe0578b93b541bb19 Mon Sep 17 00:00:00 2001 From: "Luke W. Johnston" Date: Tue, 28 Jan 2025 15:39:03 +0100 Subject: [PATCH 3/4] docs: :memo: function to write text, like README file --- docs/design/interface/python-functions.qmd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/design/interface/python-functions.qmd b/docs/design/interface/python-functions.qmd index 603cd430c..59eab6f86 100644 --- a/docs/design/interface/python-functions.qmd +++ b/docs/design/interface/python-functions.qmd @@ -338,7 +338,13 @@ outputs a `PackageProperties` object. Create a prettier, human readable version of a JSON object. ::: -## Observational unit level functions +::: {.callout-warning collapse="true"} +### `write_text(text, path)` + +Writes a text string to a file at the given path. Outputs the path +object of the created file. +::: + Observational unit is the level of detail on the entity (e.g. human, animal, event) that the data was collected on. An example would be: A From ebf12a66a9d2a3937daf26cb501f6938617b90b6 Mon Sep 17 00:00:00 2001 From: "Luke W. Johnston" Date: Tue, 28 Jan 2025 15:42:21 +0100 Subject: [PATCH 4/4] docs: :pencil2: seem I accidentally deleted this header --- docs/design/interface/python-functions.qmd | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/design/interface/python-functions.qmd b/docs/design/interface/python-functions.qmd index 59eab6f86..7c48f8e85 100644 --- a/docs/design/interface/python-functions.qmd +++ b/docs/design/interface/python-functions.qmd @@ -345,6 +345,7 @@ Writes a text string to a file at the given path. Outputs the path object of the created file. ::: +## Observational unit functions Observational unit is the level of detail on the entity (e.g. human, animal, event) that the data was collected on. An example would be: A