geowatch.tasks.fusion.fit_registery module

Experimental feature where each training run will register itself in a global registery. We can then provide a command to make it easy to check which training runs were started on this machine and where they are located.

Usage

To See

python -m geowatch.tasks.fusion.fit_registery peek
class geowatch.tasks.fusion.fit_registery.Registery(fpath=None)[source]

Bases: object

Variables:

fpath – path to the registery’s shelf database.

pandas(**kwargs)[source]
list(**kwargs)[source]
query(**kwargs)[source]
class geowatch.tasks.fusion.fit_registery.DictRegistery(fpath=None)[source]

Bases: Registery

add(key, **kwargs)[source]
set(key, **kwargs)[source]

Set an attribute of a row

remove(name)[source]
read()[source]
class geowatch.tasks.fusion.fit_registery.ListRegistery(fpath=None)[source]

Bases: Registery

Example

>>> # A minimal example that inherits from ListRegistery
>>> from geowatch.tasks.fusion.fit_registery import *  # NOQA
>>> class DemoListRegistery(ListRegistery):
>>>     __registery_fname__ = 'geowatch_fit_registery.shelf'
>>>     __appname__ = 'geowatch/demo'
>>>     __default__ = ub.udict({
>>>         'path'     : ub.NoParam,
>>>         'time'     : None,
>>>         'uuid'     : None,
>>>         'config'   : None,
>>>     })
>>> #
>>> self = DemoListRegistery()
>>> self.fpath
>>> print(self.fpath.exists())
>>> self.append(path='foo', time='bar', uuid='blag')
>>> self.append(path='foo', time='bar', uuid='blag')
>>> list(self._open().items())
>>> print(self.read())
>>> print(self.pandas())
>>> print(self.fpath.stat().st_size)
append(**kwargs)[source]
read()[source]
pandas(**kwargs)[source]
class geowatch.tasks.fusion.fit_registery.NewDVCRegistery(fpath=None)[source]

Bases: DictRegistery

class geowatch.tasks.fusion.fit_registery.FitRegistery(fpath=None)[source]

Bases: ListRegistery

This is a shelf with a single list of rows that has a globally consistent path on each machine. The __default__ attribute specifies which keys each row will have. This is used to store information whenever training is run and stores the path to its output directory. This can be used to inspect which training runs artifacts might be available on this machine and also to help the user navigate to recent paths.

Example

>>> from geowatch.tasks.fusion.fit_registery import *  # NOQA
>>> class DemoFitRegistery(FitRegistery):
>>>     __registery_fname__ = 'geowatch_demo_fit_registery.shelf'
>>>     __appname__ = 'geowatch/demo'
>>> #
>>> self = DemoFitRegistery()
>>> self.append(path=ub.Path('~').expand())
>>> self.append(path=ub.Path('~').expand())
>>> self.append(path=ub.Path('~').expand())
>>> print(self.pandas())
>>> print(self._items())

Example

>>> # This is the real one, dont modify it
>>> from geowatch.tasks.fusion.fit_registery import *  # NOQA
>>> self = FitRegistery()
>>> print(self.pandas())
>>> print(self._items())
append(**kwargs)[source]
peek()[source]
class geowatch.tasks.fusion.fit_registery.FitRegisteryCLI(description='', sub_clis=None, version=None)[source]

Bases: ModalCLI

Command line helper

class Append(*args, **kwargs)[source]

Bases: DataConfig

Register a new path (or overwrite / update an existing one)

Valid options: []

Parameters:
  • *args – positional arguments for this data config

  • **kwargs – keyword arguments for this data config

classmethod main(cmdline=1, **kwargs)[source]
default = {'path': <Value(None)>}
class List(*args, **kwargs)[source]

Bases: DataConfig

List registered paths

Valid options: []

Parameters:
  • *args – positional arguments for this data config

  • **kwargs – keyword arguments for this data config

classmethod main(cmdline=1, **kwargs)[source]
default = {}
class Peek(*args, **kwargs)[source]

Bases: DataConfig

Search for a path registered via sdvc registry add

Valid options: []

Parameters:
  • *args – positional arguments for this data config

  • **kwargs – keyword arguments for this data config

classmethod main(cmdline=1, **kwargs)[source]
default = {}