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

updated Data documentation #318

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Changes from all 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
55 changes: 52 additions & 3 deletions src/cript/nodes/primary_nodes/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class Data(PrimaryBaseNode):
"""
## Definition
A [Data node](https://pubs.acs.org/doi/suppl/10.1021/acscentsci.3c00011/suppl_file/oc3c00011_si_001.pdf#page=13)
A [Data node](https://pubs.acs.org/doi/suppl/10.1021/acscentsci.3c00011/suppl_file/oc3c00011_si_001.pdf#page=13)
node contains the meta-data to describe raw data that is beyond a single value, (i.e. n-dimensional data).
Each `Data` node must be linked to a single `Experiment` node.

Expand All @@ -19,7 +19,6 @@ class Data(PrimaryBaseNode):
## Attributes
| Attribute | Type | Example | Description | Required |
|---------------------|---------------------------------------------------|----------------------------|----------------------------------------------------------------------------------------------|----------|
| experiment | [Experiment](experiment.md) | | Experiment the data belongs to | True |
| name | str | `"my_data_name"` | Name of the data node | True |
| type | str | `"nmr_h1"` | Pick from [CRIPT data type controlled vocabulary](https://app.criptapp.org/vocab/data_type/) | True |
| file | List[[File](../supporting_nodes/file.md)] | `[file_1, file_2, file_3]` | list of file nodes | False |
Expand Down Expand Up @@ -103,7 +102,57 @@ def __init__(
citation: Optional[List[Any]] = None,
notes: str = "",
**kwargs
):
) -> None:
"""

Parameters
----------
name: str
data node name
type: str
[data type](https://app.criptapp.org/vocab/data_type) must come from CRIPT controlled vocabulary
file: List[File], default None
list of CRIPT file nodes within the data node
sample_preparation: Process, default None
sample preparation
computation: Optional[Computation], default None
data was produced from this computation method
computation_process: Optional[ComputationalProcess], default None
data was produced from this computation process
material: Optional[List[Material]], default None
materials with attributes associated with the data node
process: Optional[List[Process]], default None
processes with attributes associated with the data node
citation: Optional[List[Citation]], default None
reference to a book, paper, or scholarly work
notes: str, default ""
miscellaneous information, or custom data structure
kwargs
used for deserializing JSON into Python SDK nodes

Examples
--------
```python
# create file nodes for the data node
my_file = cript.File(
source="https://pubs.acs.org/doi/suppl/10.1021/acscentsci.3c00011/suppl_file/oc3c00011_si_001.pdf",
type="calibration",
extension=".pdf",
)

# create data node and add the file node to it
my_data = cript.Data(
name="my data node name",
type="afm_amp",
file=my_file,
)
```

Returns
-------
None

"""
super().__init__(name=name, notes=notes, **kwargs)

if file is None:
Expand Down