Skip to content

Commit 1d932c8

Browse files
authored
Merge pull request #156 from alessiamarcolini/typos-docs
Fix typos in tutorials / documentation
2 parents b2c0016 + 5fe6f07 commit 1d932c8

18 files changed

+296
-371
lines changed

AUTHORS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ Authors
33

44
* Richard Izzo - [email protected]
55
* Luca Antiga - [email protected]
6-
* Sherin Thomas - [email protected]
6+
* Sherin Thomas - [email protected]

CHANGELOG.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ Improvements
2424
(`#144 <https://github.com/tensorwerk/hangar-py/pull/144>`__) `@rlizzo <https://github.com/rlizzo>`__
2525
* Added blosc compression to HDF5 backend by default on PyPi installations.
2626
(`#146 <https://github.com/tensorwerk/hangar-py/pull/146>`__) `@rlizzo <https://github.com/rlizzo>`__
27-
* Added CLI options ``commit``, ``checkout``, ``arrayset create``, & ``arrayset remove``
27+
* Added CLI options ``commit``, ``checkout``, ``arrayset create``, & ``arrayset remove``.
2828
(`#150 <https://github.com/tensorwerk/hangar-py/pull/150>`__) `@rlizzo <https://github.com/rlizzo>`__
29-
* Plugin system revamp
29+
* Plugin system revamp.
3030
(`#134 <https://github.com/tensorwerk/hangar-py/pull/134>`__) `@hhsecond <https://github.com/hhsecond>`__
31+
* Documentation Improvements and Typo-Fixes.
32+
(`#156 <https://github.com/tensorwerk/hangar-py/pull/156>`__) `@alessiamarcolini <https://github.com/alessiamarcolini>`__
3133

3234
Bug Fixes
3335
---------

docs/Tutorial-001.ipynb

Lines changed: 43 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,18 @@
3636
"\n",
3737
"Hangar is designed to “just make sense” in every operation you have to perform.\n",
3838
"As such, there is a single interface which all interaction begins with: the\n",
39-
"``Repository`` object.\n",
39+
" designed to “just make sense” in every operation you have to perform.\n",
40+
"As such, there is a single interface which all interaction begins with: the\n",
41+
"[Repository](api.rst#hangar.repository.Repository) object.\n",
4042
"\n",
41-
"Weather a hangar repository exists at the path you specify or not, just tell\n",
43+
"Whether a hangar repository exists at the path you specify or not, just tell\n",
4244
"hangar where it should live!\n",
4345
"\n",
4446
"#### Intitializing a repository\n",
4547
"\n",
46-
"The first time you want to work with a new repository, the ``init()`` method\n",
47-
"must be called. This is where you provide hangar with your name and email\n",
48+
"The first time you want to work with a new repository, the repository \n",
49+
"[init()](api.rst#hangar.repository.Repository.init) method\n",
50+
"must be called. This is where you provide Hangar with your name and email\n",
4851
"address (to be used in the commit log), as well as implicitly confirming that\n",
4952
"you do want to create the underlying data files hangar uses on disk."
5053
]
@@ -76,7 +79,7 @@
7679
"repo = Repository(path='/Users/rick/projects/tensorwerk/hangar/dev/mnist/')\n",
7780
"\n",
7881
"# First time a repository is accessed only!\n",
79-
"# Note: if you feed a path to the `Repository` which does not contain a pre-iniitlized hangar repo, \n",
82+
"# Note: if you feed a path to the `Repository` which does not contain a pre-initialized hangar repo, \n",
8083
"# when the Repository object is initialized it will let you know that you need to run `init()`\n",
8184
"\n",
8285
"repo.init(user_name='Rick Izzo', user_email='[email protected]', remove_old=True)"
@@ -90,18 +93,18 @@
9093
"\n",
9194
"A repository can be checked out in two modes:\n",
9295
"\n",
93-
"1. write-enabled: applies all operations to the staging area’s current\n",
96+
"1. [write-enabled](api.rst#hangar.checkout.WriterCheckout): applies all operations to the staging area’s current\n",
9497
" state. Only one write-enabled checkout can be active at a different time,\n",
9598
" must be closed upon last use, or manual intervention will be needed to remove\n",
9699
" the writer lock.\n",
97100
"\n",
98-
"2. read-only: checkout a commit or branch to view repository state as it\n",
101+
"2. [read-only](api.rst#read-only-checkout): checkout a commit or branch to view repository state as it\n",
99102
" existed at that point in time.\n",
100103
" \n",
101-
"#### Lots of useful information is in the ipython `__repr__`\n",
104+
"#### Lots of useful information is in the iPython `__repr__`\n",
102105
"\n",
103106
"If you're ever in doubt about what the state of the object your working\n",
104-
"on is, just call it's reps, and the most relevant information will be\n",
107+
"on is, just call its reps, and the most relevant information will be\n",
105108
"sent to your screen!"
106109
]
107110
},
@@ -134,10 +137,11 @@
134137
"cell_type": "markdown",
135138
"metadata": {},
136139
"source": [
137-
"#### A checkout allows access to `arraysets` and `metadata`\n",
140+
"#### A checkout allows access to [arraysets](api.rst#hangar.arrayset.Arraysets) and [metadata](api.rst#hangar.metadata.MetadataWriter)\n",
138141
"\n",
139-
"The `arrayset` and `metadata` attributes of a checkout provide\n",
140-
"the interface to working with all of the data on disk!"
142+
"The [arraysets](api.rst#hangar.checkout.WriterCheckout.arraysets) and \n",
143+
"[metadata](api.rst#hangar.checkout.WriterCheckout.metadata) attributes \n",
144+
"of a checkout provide the interface to working with all of the data on disk!"
141145
]
142146
},
143147
{
@@ -222,74 +226,12 @@
222226
"source": [
223227
"#### Before data can be added to a repository, a arrayset must be initialized. \n",
224228
"\n",
225-
"A Arrayset is a named grouping of data samples where each sample shares a\n",
226-
"number of similar attributes and array properties. See the docstrings in\n",
227-
"`co.arraysets.init_arrayset`:\n",
229+
"An \"Arrayset\" is a named grouping of data samples where each sample shares a\n",
230+
"number of similar attributes and array properties. \n",
228231
"\n",
232+
"See the docstrings below or in [init_arrayset()](api.rst#hangar.arrayset.Arraysets.init_arrayset)\n",
229233
"\n",
230-
"```\n",
231-
"Initializes a arrayset in the repository.\n",
232-
"\n",
233-
"Arraysets are groups of related data pieces (samples). All samples within\n",
234-
"a arrayset have the same data type, and number of dimensions. The size of\n",
235-
"each dimension can be either fixed (the default behavior) or variable\n",
236-
"per sample.\n",
237-
"\n",
238-
"For fixed dimension sizes, all samples written to the arrayset must have\n",
239-
"the same size that was initially specified upon arrayset initialization.\n",
240-
"Variable size arraysets on the other hand, can write samples with\n",
241-
"dimensions of any size less than a maximum which is required to be set\n",
242-
"upon arrayset creation.\n",
243-
"\n",
244-
"Parameters\n",
245-
"----------\n",
246-
"name : str\n",
247-
" The name assigned to this arrayset.\n",
248-
"shape : Union[int, Tuple[int]]\n",
249-
" The shape of the data samples which will be written in this arrayset.\n",
250-
" This argument and the `dtype` argument are required if a `prototype`\n",
251-
" is not provided, defaults to None.\n",
252-
"dtype : np.dtype\n",
253-
" The datatype of this arrayset. This argument and the `shape` argument\n",
254-
" are required if a `prototype` is not provided., defaults to None.\n",
255-
"prototype : np.ndarray\n",
256-
" A sample array of correct datatype and shape which will be used to\n",
257-
" initialize the arrayset storage mechanisms. If this is provided, the\n",
258-
" `shape` and `dtype` arguments must not be set, defaults to None.\n",
259-
"named_samples : bool, optional\n",
260-
" If the samples in the arrayset have names associated with them. If set,\n",
261-
" all samples must be provided names, if not, no name will be assigned.\n",
262-
" defaults to True, which means all samples should have names.\n",
263-
"variable_shape : bool, optional\n",
264-
" If this is a variable sized arrayset. If true, a the maximum shape is\n",
265-
" set from the provided `shape` or `prototype` argument. Any sample\n",
266-
" added to the arrayset can then have dimension sizes <= to this\n",
267-
" initial specification (so long as they have the same rank as what\n",
268-
" was specified) defaults to False.\n",
269-
"backend : DEVELOPER USE ONLY. str, optional, kwarg only\n",
270-
" Backend which should be used to write the arrayset files on disk.\n",
271-
"\n",
272-
"Returns\n",
273-
"-------\n",
274-
":class:`ArraysetDataWriter`\n",
275-
" instance object of the initialized arrayset.\n",
276-
"\n",
277-
"Raises\n",
278-
"------\n",
279-
"ValueError\n",
280-
" If provided name contains any non ascii, non alpha-numeric characters.\n",
281-
"ValueError\n",
282-
" If required `shape` and `dtype` arguments are not provided in absence of\n",
283-
" `prototype` argument.\n",
284-
"ValueError\n",
285-
" If `prototype` argument is not a C contiguous ndarray.\n",
286-
"ValueError\n",
287-
" If rank of maximum tensor shape > 31.\n",
288-
"ValueError\n",
289-
" If zero sized dimension in `shape` argument\n",
290-
"ValueError\n",
291-
" If the specified backend is not valid.\n",
292-
"```"
234+
".. automethod:: hangar.arrayset.Arraysets.init_arrayset"
293235
]
294236
},
295237
{
@@ -333,13 +275,13 @@
333275
"however, depending on your use case, this may or may not be the most convenient\n",
334276
"way to access a arrayset.\n",
335277
"\n",
336-
"In general, we have implemented a full ``dict`` mapping interface on top of all\n",
337-
"object. To access the ``'mnist_training_images'`` arrayset you can just use a\n",
338-
"dict style access like the following (note: if operating in ipython/jupyter, the\n",
278+
"In general, we have implemented a full `dict` mapping interface on top of all\n",
279+
"objects. To access the `'mnist_training_images'` arrayset you can just use a\n",
280+
"dict style access like the following (note: if operating in iPython/Jupyter, the\n",
339281
"arrayset keys will autocomplete for you).\n",
340282
"\n",
341283
"The arrayset objects returned here contain many useful instrospecion methods which\n",
342-
"we will review over the rest of the turtorial"
284+
"we will review over the rest of the tutorial."
343285
]
344286
},
345287
{
@@ -411,9 +353,9 @@
411353
"source": [
412354
"#### Through the checkout object (arrayset and sample access)\n",
413355
"\n",
414-
"In addition to the standard `co.arraysets` access methods, we have implemented a convenience mapping to `arraysets` and `samples` (ie. data) for both reading and writing from the `checkout` object itself. \n",
356+
"In addition to the standard `co.arraysets` access methods, we have implemented a convenience mapping to [arraysets](api.rst#hangar.arrayset.Arraysets) and [samples](api.rst#hangar.arrayset.ArraysetDataWriter) (ie. data) for both reading and writing from the [checkout](api.rst#hangar.checkout.WriterCheckout) object itself. \n",
415357
"\n",
416-
"to get the same arrayset object from the checkout, simply use:"
358+
"To get the same arrayset object from the checkout, simply use:"
417359
]
418360
},
419361
{
@@ -450,7 +392,7 @@
450392
"cell_type": "markdown",
451393
"metadata": {},
452394
"source": [
453-
"Though that works as expected, most use cases will take advantage of adding and reading data from multiple arraysets / samples at a time. This is shown in the next section"
395+
"Though that works as expected, most use cases will take advantage of adding and reading data from multiple arraysets / samples at a time. This is shown in the next section."
454396
]
455397
},
456398
{
@@ -459,8 +401,10 @@
459401
"source": [
460402
"#### Adding Data\n",
461403
"\n",
462-
"To add data to a named arrayset, we can use dict-style setting, or the\n",
463-
"``.add`` method. Sample keys can be either `str` or `int` type."
404+
"To add data to a named arrayset, we can use [dict-style setting](api.rst#hangar.arrayset.ArraysetDataWriter) \n",
405+
"(refer to the `__setitem__`, `__getitem__`, and `__delitem__` methods), \n",
406+
"or the [add()](api.rst#hangar.arrayset.ArraysetDataWriter.add) method. \n",
407+
"Sample keys can be either `str` or `int` type."
464408
]
465409
},
466410
{
@@ -700,7 +644,8 @@
700644
"### Performance\n",
701645
"\n",
702646
"Once you’ve completed an interactive exploration, be sure to use the context\n",
703-
"manager form of the ``.add`` and ``.get`` methods!\n",
647+
"manager form of the [add()](api.rst#hangar.arrayset.ArraysetDataWriter.add) and \n",
648+
"[get()](api.rst#hangar.arrayset.ArraysetDataWriter.get) methods!\n",
704649
"\n",
705650
"In order to make sure that all your data is always safe in Hangar, the backend\n",
706651
"diligently ensures that all contexts (operations which can somehow interact\n",
@@ -808,7 +753,7 @@
808753
"source": [
809754
"### Commiting Changes\n",
810755
"\n",
811-
"Once you have made a set of changes you wan't to commit, just simply call the `commit()` method (and pass in a message)!"
756+
"Once you have made a set of changes you want to commit, just simply call the [commit()](api.rst#hangar.checkout.WriterCheckout.commit) method (and pass in a message)!"
812757
]
813758
},
814759
{
@@ -837,8 +782,7 @@
837782
"source": [
838783
"The returned value (`'e11d061dc457b361842801e24cbd119a745089d6'`) is the commit hash of this commit. It\n",
839784
"may be useful to assign this to a variable and follow this up by creating a\n",
840-
"branch from this commit! (Branching to be covered in the next round of\n",
841-
"tutorials)"
785+
"branch from this commit!"
842786
]
843787
},
844788
{
@@ -847,18 +791,19 @@
847791
"source": [
848792
"#### Don't Forget to Close the Write-Enabled Checkout to Release the Lock!\n",
849793
"\n",
850-
"We mentioned in `Checking out the repo for writing`_ that when a\n",
851-
"``write-enabled`` checkout is created, it places a lock on writers until it is\n",
794+
"We mentioned in `Checking out the repo for writing` that when a\n",
795+
"`write-enabled` checkout is created, it places a lock on writers until it is\n",
852796
"closed. If for whatever reason the program terminates via a non python `SIGKILL` or fatal\n",
853797
"interpreter error without closing the\n",
854798
"write-enabled checkout, this lock will persist (forever technically, but\n",
855799
"realistically until it is manually freed).\n",
856800
"\n",
857801
"Luckily, preventing this issue from occurring is as simple as calling\n",
858-
"``close()``!\n",
802+
"[close()](api.rst#hangar.checkout.WriterCheckout.close)!\n",
859803
"\n",
860804
"If you forget, normal interperter shutdown should trigger an `atexit` hook automatically,\n",
861-
"however this behavior should not be relied upon. better to just call ``close()``"
805+
"however this behavior should not be relied upon. Is better to just call\n",
806+
"[close()](api.rst#hangar.checkout.WriterCheckout.close)."
862807
]
863808
},
864809
{
@@ -877,15 +822,15 @@
877822
"#### But if you did forget, and you recieve a `PermissionError` next time you open a checkout\n",
878823
"\n",
879824
"```\n",
880-
"PermissionError: Cannot aquire the writer lock. Only one instance of\n",
825+
"PermissionError: Cannot acquire the writer lock. Only one instance of\n",
881826
"a writer checkout can be active at a time. If the last checkout of this \n",
882827
"repository did not properly close, or a crash occured, the lock must be\n",
883828
"manually freed before another writer can be instantiated.\n",
884829
"```\n",
885830
"\n",
886831
"You can manually free the lock with the following method. However!\n",
887832
"\n",
888-
"This is a dangerous operation, and is one of the only ways where a user can put\n",
833+
"This is a dangerous operation, and it's one of the only ways where a user can put\n",
889834
"data in their repository at risk! If another python process is still holding the\n",
890835
"lock, do NOT force the release. Kill the process (that's totally fine to do at\n",
891836
"any time, then force the lock release)."
@@ -1036,4 +981,4 @@
1036981
},
1037982
"nbformat": 4,
1038983
"nbformat_minor": 4
1039-
}
984+
}

0 commit comments

Comments
 (0)