Skip to content

Commit

Permalink
Fixed misspelling (#832)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesper-friis authored May 25, 2024
1 parent d04f792 commit dd4deaf
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ True
We can create an instance of `Person` with

```python
homes = Person(
holmes = Person(
dimensions={"nskills": 4},
properties={
"name": "Sherlock Homes",
"name": "Sherlock Holmes",
"skills": ["observing", "chemistry", "violin", "boxing"],
}
)
Expand All @@ -123,25 +123,25 @@ By specifying it, we initialise the properties to the provided values

In this case we didn't initialised the age
```python
>>> homes.age
>>> holmes.age
0.0
>>> homes.age = 34 # Assign the age
>>> holmes.age = 34 # Assign the age
```

If you have [Pint] installed, you can also specify or access the age
as a quantity with unit
```python
>>> homes.q.age = "34year"
>>> homes.q.age
>>> holmes.q.age = "34year"
>>> holmes.q.age
<Quantity(34, 'year')>
>>> homes.q.age.to("century").m
>>> holmes.q.age.to("century").m
0.34
```

We can view (a JSON representation of) the instance with

```python
>>> print(homes)
>>> print(holmes)
{
"uuid": "314ac1ad-4a7e-477b-a56c-939121355112",
"meta": "http://onto-ns.com/meta/0.1/Person",
Expand All @@ -165,7 +165,7 @@ We can view (a JSON representation of) the instance with
The instance can also be stored using the `save()` method

```python
homes.save("yaml", "homes.yaml", "mode=w")
holmes.save("yaml", "holmes.yaml", "mode=w")
```

which will produce the a YAML file with the following content
Expand Down

0 comments on commit dd4deaf

Please sign in to comment.