Skip to content

Commit 39ed1bb

Browse files
committed
remove unused import and adjust lines in documentation
1 parent 68b8b98 commit 39ed1bb

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

docs/tutorials/python/json_schema.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ By the end of this tutorial, you will:
2424
## 1. Set Up Synapse Python Client and Retrieve Project
2525

2626
```python
27-
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=1-20}
27+
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=1-19}
2828
```
2929

3030
## 2. Take a Look at the Constants and Structure of the JSON Schema
3131

3232
```python
33-
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=23-49}
33+
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=22-49}
3434
```
3535

3636
Derived annotations allow you to define default values for annotations based on schema rules, ensuring consistency and reducing manual input errors. As you can see here, you could use derived annotations to prescribe default annotation values. Please read more about derived annotations [here](https://help.synapse.org/docs/JSON-Schemas.3107291536.html#JSONSchemas-DerivedAnnotations).
@@ -39,12 +39,12 @@ Derived annotations allow you to define default values for annotations based on
3939
## 3. Try Create Test Organization and JSON Schema if They Do Not Exist
4040
Next, try creating a test organization and register a schema if they do not already exist:
4141
```python
42-
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=52-65}
42+
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=51-65}
4343
```
4444

4545
Note: If you make an update to your schema, you can re-register your schema with the organization and give it a new version number:
4646
```python
47-
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=68-90}
47+
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=67-90}
4848
```
4949

5050
## 4. Bind the JSON Schema to the Folder
@@ -53,7 +53,7 @@ After creating the organization, you can now bind your json schema to a test fol
5353
When you bind the schema, you may also include the boolean property `enable_derived_annos` to have Synapse automatically calculate derived annotations based on the schema:
5454

5555
```python
56-
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=94-100}
56+
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=93-100}
5757
```
5858

5959
<details class="example">
@@ -76,7 +76,7 @@ JSON schema was bound successfully. Please see details below:
7676
## 5. Retrieve the Bound Schema
7777
Next, we can retrieve the bound schema:
7878
```python
79-
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=103-105}
79+
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=102-105}
8080
```
8181

8282
<details class="example">
@@ -105,12 +105,12 @@ JSON Schema was retrieved successfully. Please see details below:
105105
## 6. Add Invalid Annotations to the Folder and Store, and Validate the Folder against the Schema
106106
Try adding invalid annotations to your folder: This step and the step below demonstrate how the system handles invalid annotations and how the schema validation process works.
107107
```python
108-
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=108-112}
108+
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=107-111}
109109
```
110110

111111
Try validating the folder. You should be able to see messages related to invalid annotations.
112112
```python
113-
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=116-118}
113+
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=115-117}
114114
```
115115

116116

@@ -146,12 +146,12 @@ This step is only relevant for container entities, such as a folder or a project
146146

147147
Try creating a test file locally and store the file in the folder that we created earlier. Then, try adding invalid annotations to a file. This step demonstrates how the files inside a folder also inherit the schema from the parent entity.
148148
```python
149-
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=122-148}
149+
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=121-146}
150150
```
151151

152152
You could then use `get_schema_validation_statistics` to get information such as the number of children with invalid annotations inside a container.
153153
```python
154-
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=150-152}
154+
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=149-151}
155155
```
156156

157157

@@ -170,7 +170,7 @@ Validation statistics were retrieved successfully. Please see details below:
170170

171171
You could also use `get_invalid_validation` to see more detailed results of all the children inside a container, which includes all validation messages and validation exception details.
172172
```python
173-
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=154-159}
173+
{!docs/tutorials/python/tutorial_scripts/json_schema.py!lines=153-158}
174174
```
175175

176176
<details class="example">

docs/tutorials/python/tutorial_scripts/json_schema.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from pprint import pprint
44

55
import synapseclient
6-
from synapseclient.core.exceptions import SynapseHTTPError
76
from synapseclient.models import File, Folder
87

98
# 1. Set up Synapse Python client and retrieve project
@@ -13,7 +12,7 @@
1312

1413
# Retrieve test project
1514
PROJECT_ID = syn.findEntityId(
16-
name="My uniquely named project about Alzheimer's Disease"
15+
name="My uniquely named project about Alzheimer's Disease 2"
1716
)
1817

1918
# Create a test folder for JSON schema experiments

0 commit comments

Comments
 (0)