Skip to content

Commit

Permalink
Merge pull request #18 from tidoust/doc-fixes
Browse files Browse the repository at this point in the history
Code fixes in documentation
  • Loading branch information
turukawa authored May 24, 2024
2 parents 49d3bf4 + 14e2fb0 commit 5e4b8b0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/strategies/curation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Curation
summary: Data curation includes all the processes and techniques needed for ethical and reproducable data creation, management, transformation and presentation for reuse.
summary: Data curation includes all the processes and techniques needed for ethical and reproducible data creation, management, transformation and presentation for reuse.
authors:
- Gavin Chait
date: 2023-05-03
Expand Down
18 changes: 9 additions & 9 deletions docs/strategies/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,13 @@ You could also `add`:

```python
for field in fields:
schema.fields.add(terms=field)
schema_destination.fields.add(term=field)
```

From here on we can access any `field` by calling it by `name` and then updating it as required:

```python
schema.fields.get(name="occupation_state_reliefs")
schema_destination.fields.get(name="occupation_state_reliefs")

{'name': 'occupation_state_reliefs',
'type': 'array',
Expand All @@ -369,12 +369,12 @@ Let's add a list of `category` terms as a constraint for `occupation_state_relie
```python
categories = ["small_business", "rural", "charity", "enterprise_zone", "vacancy", "hardship", "retail", "discretionary", "exempt", "transitional", "other"]
constraints = {
"categories": [{
"name": category for category in categories
}]
"category": [
{ "name": category } for category in categories
]
}
schema.fields.set_constraints(name="occupation_state_reliefs", constraints=constraints)
schema.fields.get(name="occupation_state_reliefs").dict(by_alias=True, exclude_defaults=True, exclude_none=True)
schema_destination.fields.set_constraints(name="occupation_state_reliefs", constraints=constraints)
schema_destination.fields.get(name="occupation_state_reliefs").dict(by_alias=True, exclude_defaults=True, exclude_none=True)

{'uuid': UUID('cf4d066e-22a8-4b76-8956-f6120eec4c52'),
'name': 'occupation_state_reliefs',
Expand Down Expand Up @@ -409,7 +409,7 @@ the underlying [Pydantic](https://pydantic-docs.helpmanual.io/) model used by `w
Review your schema, then `save` and we're ready to begin schema-to-schema conversion:

```python
schema.get.dict(by_alias=True, exclude_defaults=True, exclude_none=True)
schema_destination.get.dict(by_alias=True, exclude_defaults=True, exclude_none=True)

{'uuid': UUID('19692345-2caf-46b1-9a8f-276491520c6b'),
'name': 'test_schema',
Expand Down Expand Up @@ -480,7 +480,7 @@ schema.get.dict(by_alias=True, exclude_defaults=True, exclude_none=True)
{'uuid': UUID('8a3af6f4-f48c-4614-83f2-ba472b2129e9'),
'name': 'other'}]}}]}

schema.save(directory=directory, filename=filename, created_by="Gavin Chait")
schema_destination.save(directory=directory, filename=filename, created_by="Gavin Chait")
```

Whyqd's [data source strategies](datasource.md) show you how to derive a schema to reflect source data.
4 changes: 2 additions & 2 deletions docs/tutorials/tutorial3.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ This leaves the following to be done in the destination crosswalk:
- Join all the separate 'Reference' columns into a single column.

```python
SCHEMA_INTERIM.get.index = transform.get.dataDestination.index
SCHEMA_INTERIM.get.index = transform_interim.get.dataDestination.index
crosswalk_destination = qd.CrosswalkDefinition()
crosswalk_destination.set(schema_source=SCHEMA_INTERIM, schema_destination=SCHEMA_DESTINATION)
# Create the crosswalk
Expand Down Expand Up @@ -367,7 +367,7 @@ The interim schema doesn't have an index count, but we're doing a lot of physica
pass this index from the transform to ensure that the destination transform remains within bounds.

```python
transform = qd.TransformDefinition(crosswalk=crosswalk, data_source=transform_interim.get.dataDestination)
transform = qd.TransformDefinition(crosswalk=crosswalk_destination, data_source=transform_interim.get.dataDestination)
transform.process()
transform.save(directory=DIRECTORY)
```
Expand Down

0 comments on commit 5e4b8b0

Please sign in to comment.