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

Reference to Module API #59

Merged
merged 5 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/terminology.md → docs/source/algorithm.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ During initialization, we will be given the following inputs:

##### `cfg`

`cfg` is a `TaskExtractorConfig` object containing our task definition, include all information about
`cfg` is a {py:class}`aces.config.TaskExtractorConfig` object containing our task definition, include all information about
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure the class reference uses the correct Sphinx notation.

- cfg is a {py:class}`aces.config.TaskExtractorConfig`
+ cfg is a :py:class:`aces.config.TaskExtractorConfig`

This correction ensures that the class reference is properly formatted for Sphinx documentation, allowing for correct rendering and linking.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
`cfg` is a {py:class}`aces.config.TaskExtractorConfig` object containing our task definition, include all information about
`cfg` is a :py:class:`aces.config.TaskExtractorConfig` object containing our task definition, include all information about
Tools
LanguageTool

[uncategorized] ~191-~191: This verb may not be in the correct form. Consider using a different form for this context. (AI_EN_LECTOR_REPLACEMENT_VERB_FORM)
Context: ... object containing our task definition, include all information about predicates, the t...

predicates, the trigger event, and windows.

##### `predicates_df`
Expand Down
16 changes: 8 additions & 8 deletions docs/source/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ format (recommended) or the [ESGPT](https://eventstreamml.readthedocs.io/en/late
system works by defining a configuration object that details the underlying concepts, inclusion/exclusion, and
labeling criteria for the cohort/task to be extracted, then using a recursive algorithm to identify all
realizations of valid patient time-ranges of data that satisfy those constraints from the raw data. For more
details on the recursive algorithm, see the `terminology.md` file.
details on the recursive algorithm, see [Algorithm Design](https://eventstreamaces.readthedocs.io/en/latest/technical.html#algorithm-design).

As indicated above, these cohorts are specified through a combination of concepts (realized as event
_predicate_ functions, _aka_ "predicates") which are _dataset specific_ and inclusion/exclusion/labeling
Expand All @@ -28,10 +28,10 @@ ______________________________________________________________________
In the machine form used by ACES, the configuration file consists of three parts:

- `predicates`, stored as a dictionary from string predicate names (which must be unique) to either
`PlainPredicateConfig` objects, which store raw predicates with no dependencies on other predicates, or
`DerivedPredicateConfig` objects, which store predicates that build on other predicates.
{py:class}`aces.config.PlainPredicateConfig` objects, which store raw predicates with no dependencies on other predicates, or
{py:class}`aces.config.DerivedPredicateConfig` objects, which store predicates that build on other predicates.
- `trigger`, stored as a string to `EventConfig`
- `windows`, stored as a dictionary from string window names (which must be unique) to `WindowConfig`
- `windows`, stored as a dictionary from string window names (which must be unique) to {py:class}`aces.config.WindowConfig`
Comment on lines +31 to +34
Copy link
Contributor

Choose a reason for hiding this comment

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

Update class references to use consistent and correct Sphinx notation.

- {py:class}`aces.config.PlainPredicateConfig`
+ :py:class:`aces.config.PlainPredicateConfig`
- {py:class}`aces.config.DerivedPredicateConfig`
+ :py:class:`aces.config.DerivedPredicateConfig`
- {py:class}`aces.config.WindowConfig`
+ :py:class:`aces.config.WindowConfig`

This change corrects the syntax for referencing Python classes in Sphinx documentation, ensuring that the documentation is properly rendered.

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{py:class}`aces.config.PlainPredicateConfig` objects, which store raw predicates with no dependencies on other predicates, or
{py:class}`aces.config.DerivedPredicateConfig` objects, which store predicates that build on other predicates.
- `trigger`, stored as a string to `EventConfig`
- `windows`, stored as a dictionary from string window names (which must be unique) to `WindowConfig`
- `windows`, stored as a dictionary from string window names (which must be unique) to {py:class}`aces.config.WindowConfig`
:py:class:`aces.config.PlainPredicateConfig` objects, which store raw predicates with no dependencies on other predicates, or
:py:class:`aces.config.DerivedPredicateConfig` objects, which store predicates that build on other predicates.
- `trigger`, stored as a string to `EventConfig`
- `windows`, stored as a dictionary from string window names (which must be unique) to :py:class:`aces.config.WindowConfig`
Tools
LanguageTool

[uncategorized] ~33-~33: Loose punctuation mark. (UNLIKELY_OPENING_PUNCTUATION)
Context: ...t build on other predicates. - trigger, stored as a string to EventConfig - `...

objects.

Below, we will detail each of these configuration objects.
Expand All @@ -40,7 +40,7 @@ ______________________________________________________________________

### Predicates: `PlainPredicateConfig` and `DerivedPredicateConfig`

#### `PlainPredicateConfig`: Configuration of Predicates that can be Computed Directly from Raw Data
#### {py:class}`aces.config.PlainPredicateConfig`: Configuration of Predicates that can be Computed Directly from Raw Data

These configs consist of the following four fields:

Expand Down Expand Up @@ -87,7 +87,7 @@ on its source format.
be of the univariate regression type and its value, if needed, will be pulled from the corresponding
column.

#### `DerivedPredicateConfig`: Configuration of Predicates that Depend on Other Predicates
#### {py:class}`aces.config.DerivedPredicateConfig`: Configuration of Predicates that Depend on Other Predicates

These configuration objects consist of only a single string field--`expr`--which contains a limited grammar of
accepted operations that can be applied to other predicates, containing precisely the following:
Expand All @@ -100,7 +100,7 @@ analytic operations over predicates.

______________________________________________________________________

### Events: `EventConfig`
### Events: {py:class}`aces.config.EventConfig`

The event config consists of only a single field, `predicate`, which specifies the predicate that must be
observed with value greater than one to satisfy the event. There can only be one defined "event" with an
Expand All @@ -110,7 +110,7 @@ The value of its field can be any defined predicate.

______________________________________________________________________

### Windows: `WindowConfig`
### Windows: {py:class}`aces.config.WindowConfig`

Windows contain a tracking `name` field, and otherwise are specified with two parts: (1) A set of four
parameters (`start`, `end`, `start_inclusive`, and `end_inclusive`) that specify the time range of the window,
Expand Down
2 changes: 1 addition & 1 deletion docs/source/technical.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
```{include} configuration.md
```

```{include} terminology.md
```{include} algorithm.md
```
27 changes: 9 additions & 18 deletions docs/source/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,13 @@ windows:

You can now run `aces-cli` in your terminal. Suppose we have a directory structure like the following:

```
ACES/
├── sample_data/
│ ├── esgpt_sample/
│ │ ├── ...
│ │ ├── events_df.parquet
│ │ └── dynamic_measurements_df.parquet
│ ├── meds_sample/
│ │ ├── shards/
│ │ │ ├── 0.parquet
│ │ │ └── 1.parquet
│ │ └── sample_shard.parquet
│ └── sample_data.csv
├── sample_configs/
│ └── inhospital_mortality.yaml
└── ...
```yaml
ACES/ ├── sample_data/ │ ├── esgpt_sample/ │ │ ├── ... │ │ ├── events_df.parquet
│ │ └── dynamic_measurements_df.parquet │ ├── meds_sample/ │ │ ├── shards/
│ │ │ ├── 0.parquet │ │ │ └── 1.parquet │ │ └── sample_shard.parquet
│ └── sample_data.csv ├── sample_configs/ │ └── inhospital_mortality.yaml └──
...
...
```

**To query from a single MEDS shard**:
Expand Down Expand Up @@ -175,7 +166,7 @@ To query from a direct predicates dataframe:

#### Task Configuration

`cohort_dir`: Directory the your task configuration file
`cohort_dir`: Directory of your task configuration file

`cohort_name`: Name of the task configuration file

Expand Down Expand Up @@ -237,7 +228,7 @@ You can also use the `aces.query.query()` function to extract a cohort in Python
.. autofunction:: aces.query.query
```

The `cfg` parameter must be of type `config.TaskExtractorConfig`, and the `predicates_df` parameter must be of type `polars.DataFrame`.
The `cfg` parameter must be of type {py:class}`aces.config.TaskExtractorConfig`, and the `predicates_df` parameter must be of type `polars.DataFrame`.

Details about the configuration language used to define the `cfg` parameter can be found in {doc}`/configuration`.

Expand Down
Loading