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

Convenience Methods #183

Merged
merged 8 commits into from
Mar 7, 2020
Merged
Show file tree
Hide file tree
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
26 changes: 26 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ Improvements
New Features
------------

* Added ``.diff()`` method to ``Repository`` class to enable diffing changes between any pair of
commits / branches without needing to open the diff base in a checkout.
(`#183 <https://github.com/tensorwerk/hangar-py/pull/183>`__) `@rlizzo <https://github.com/rlizzo>`__
* New CLI command ``hangar diff`` which reports a summary view of changes made between any pair of
commits / branches.
(`#183 <https://github.com/tensorwerk/hangar-py/pull/183>`__) `@rlizzo <https://github.com/rlizzo>`__
* Added ``.log()`` method to ``Checkout`` objects so graphical commit graph or machine readable
commit details / DAG can be queried when operating on a particular commit.
(`#183 <https://github.com/tensorwerk/hangar-py/pull/183>`__) `@rlizzo <https://github.com/rlizzo>`__
* "string" type columns now supported alongside "ndarray" column type.
(`#180 <https://github.com/tensorwerk/hangar-py/pull/180>`__) `@rlizzo <https://github.com/rlizzo>`__
* New "column" API, which replaces "arrayset" name.
Expand All @@ -45,6 +54,23 @@ New Features
(`#173 <https://github.com/tensorwerk/hangar-py/pull/173>`__) `@rlizzo <https://github.com/rlizzo>`__


Changes
-------

* Argument syntax of ``__getitem__()`` and ``get()`` methods of ``ReaderCheckout`` and
``WriterCheckout`` classes. The new format supports handeling arbitrary arguments specific
to retrieval of data from any column type.
(`#183 <https://github.com/tensorwerk/hangar-py/pull/183>`__) `@rlizzo <https://github.com/rlizzo>`__


Removed
-------

* ``__setitem__()`` method in ``WriterCheckout`` objects. Writing data to columns via a checkout object
is no longer supported.
(`#183 <https://github.com/tensorwerk/hangar-py/pull/183>`__) `@rlizzo <https://github.com/rlizzo>`__


Bug Fixes
---------

Expand Down
18 changes: 0 additions & 18 deletions docs/Tutorial-001.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -694,10 +694,6 @@
"--------------------------------\n",
"Finished context manager form in: 11.608536720275879 seconds\n",
"Hard reset requested with writer_lock: ad4a2ef9-8494-49f8-84ef-40c3990b1e9b\n",
"\n",
"Beginning context manager form with checkout access\n",
"--------------------------------\n",
"Finished context manager with checkout form in: 13.474638223648071 seconds\n"
]
}
],
Expand Down Expand Up @@ -743,20 +739,6 @@
"co.reset_staging_area()\n",
"co.close()\n",
"\n",
"# -------------- Context Manager With Checkout Access -------------\n",
"\n",
"co = repo.checkout(write=True)\n",
"co.add_ndarray_column(name='train_images', prototype=sample_trimg)\n",
"co.add_ndarray_column(name='train_labels', prototype=sample_trlabel)\n",
"\n",
"print(f'\\nBeginning context manager form with checkout access')\n",
"print('--------------------------------')\n",
"start_time = time.time()\n",
"\n",
"with co:\n",
" for idx, img in enumerate(trimgs):\n",
" co[['train_images', 'train_labels'], idx] = [img, np.array([trlabels[idx]])]\n",
"\n",
"print(f'Finished context manager with checkout form in: {time.time() - start_time} seconds')"
]
},
Expand Down
2 changes: 2 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Checkout

.. autoclass:: hangar.checkout.WriterCheckout()
:members:
:inherited-members:
:special-members: __getitem__, __setitem__, __len__, __contains__, __iter__
:exclude-members: __init__

Expand Down Expand Up @@ -86,6 +87,7 @@ Checkout

.. autoclass:: hangar.checkout.ReaderCheckout()
:members:
:inherited-members:
:special-members: __getitem__, __len__, __contains__, __iter__
:exclude-members: __init__

Expand Down
Loading