diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..9e3a349 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,31 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/.readthedocs.yml b/.readthedocs.yml index 58beca9..1476583 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -8,6 +8,7 @@ version: 2 # Build documentation in the docs/ directory with Sphinx sphinx: configuration: docs/source/conf.py + fail_on_warning: false conda: environment: environment.yml diff --git a/MANIFEST.in b/MANIFEST.in index ad4b996..c4403f8 100755 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,2 @@ -include playground_plums/dataflow/utils/parser/grammar.lark -include playground_plums/plot/engine/fonts/*.ttf +include plums/dataflow/utils/parser/grammar.lark +include plums/plot/engine/fonts/*.ttf diff --git a/README.md b/README.md index 71b7551..33dafa5 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ debug and reuse. Installation is simple with *PyPI* repository: ```bash -pip install playground-plums +pip install plums ``` [TODO] @@ -32,7 +32,7 @@ reusable classes and utilities for all other packages. To import do: ```python -import playground_plums.commons +import plums.commons ``` ### Plot @@ -44,7 +44,7 @@ results. To import do: ```python -import playground_plums.plot +import plums.plot ``` ### Model @@ -57,7 +57,7 @@ producer and consumer codebases. To import do: ```python -import playground_plums.model +import plums.model ``` ### Dataflow @@ -68,7 +68,7 @@ handling. To import do: ```python -import playground_plums.dataflow +import plums.dataflow ``` ------------------------------------------------------------------- diff --git a/docs/source/api_doc/plums.commons.data.rst b/docs/source/api_doc/plums.commons.data.rst index aa2a2b9..8d086d9 100755 --- a/docs/source/api_doc/plums.commons.data.rst +++ b/docs/source/api_doc/plums.commons.data.rst @@ -20,40 +20,40 @@ It consists of 2 categories of classes: Container classes ----------------- -.. autoclass:: playground_plums.commons.data.data.DataPoint +.. autoclass:: plums.commons.data.data.DataPoint :members: :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.commons.data.data.Annotation +.. autoclass:: plums.commons.data.data.Annotation :members: :undoc-members: :show-inheritance: :member-order: bysource .. Test -.. automodule:: playground_plums.commons +.. automodule:: plums.commons :members: DataPoint, Annotation :undoc-members: :show-inheritance: :exclude-members: p, r, o, e, t, i, s :member-order: bysource -.. autoclass:: playground_plums.commons.data.tile.TileCollection +.. autoclass:: plums.commons.data.tile.TileCollection :members: :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.commons.data.record.RecordCollection(*records, id=None, taxonomy=None) +.. autoclass:: plums.commons.data.record.RecordCollection(*records, id=None, taxonomy=None) :members: :special-members: __getitem__, __setitem__, __len__ :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.commons.data.mask.MaskCollection +.. autoclass:: plums.commons.data.mask.MaskCollection :members: :special-members: __getitem__ :undoc-members: @@ -66,20 +66,20 @@ Type classes Tile classes ++++++++++++ -.. autoclass:: playground_plums.commons.data.tile.Tile +.. autoclass:: plums.commons.data.tile.Tile :members: :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.commons.data.tile.TileWrapper +.. autoclass:: plums.commons.data.tile.TileWrapper :members: :undoc-members: :show-inheritance: :member-order: bysource .. Test -.. automodule:: playground_plums.commons +.. automodule:: plums.commons :members: Tile, TileWrapper :undoc-members: :show-inheritance: @@ -89,7 +89,7 @@ Tile classes Record classes ++++++++++++++ -.. autoclass:: playground_plums.commons.data.record.Record +.. autoclass:: plums.commons.data.record.Record :members: :undoc-members: :show-inheritance: @@ -98,20 +98,20 @@ Record classes Mask classes ++++++++++++ -.. autoclass:: playground_plums.commons.data.mask.VectorMask +.. autoclass:: plums.commons.data.mask.VectorMask :members: :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.commons.data.mask.RasterMask +.. autoclass:: plums.commons.data.mask.RasterMask :members: :undoc-members: :show-inheritance: :member-order: bysource .. Test -.. automodule:: playground_plums.commons +.. automodule:: plums.commons :members: VectorMask, RasterMask :undoc-members: :show-inheritance: @@ -124,32 +124,32 @@ Developper documentation Some internal classes used for interface-checking and semantic typing and base classes for the data model implementation. -.. autoclass:: playground_plums.commons.data.mixin.PropertyContainer +.. autoclass:: plums.commons.data.mixin.PropertyContainer :members: :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.commons.data.base.ArrayInterfaced +.. autoclass:: plums.commons.data.base.ArrayInterfaced :members: :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.commons.data.base.GeoInterfaced +.. autoclass:: plums.commons.data.base.GeoInterfaced :members: :undoc-members: :show-inheritance: :member-order: bysource .. Test -.. automodule:: playground_plums.commons.data +.. automodule:: plums.commons.data :members: ArrayInterfaced, GeoInterfaced :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.commons.data.Mask(name, id=None, **properties) +.. autoclass:: plums.commons.data.Mask(name, id=None, **properties) :members: :undoc-members: :show-inheritance: @@ -159,21 +159,21 @@ Implementation helpers ---------------------- .. Test -.. autoclass:: playground_plums.commons.data.mixin.PropertyContainer +.. autoclass:: plums.commons.data.mixin.PropertyContainer :members: :undoc-members: :show-inheritance: :member-order: bysource .. Test -.. automodule:: playground_plums.commons.data.mixin +.. automodule:: plums.commons.data.mixin :members: :exclude-members: PropertyContainer, p, r, o, e, t, i, s, d, c :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.commons.data.base._Array +.. autoclass:: plums.commons.data.base._Array :members: :undoc-members: :show-inheritance: diff --git a/docs/source/api_doc/plums.commons.data.taxonomy.rst b/docs/source/api_doc/plums.commons.data.taxonomy.rst index d627fa8..a3186f1 100755 --- a/docs/source/api_doc/plums.commons.data.taxonomy.rst +++ b/docs/source/api_doc/plums.commons.data.taxonomy.rst @@ -17,7 +17,7 @@ It mainly consists in 3 classes: The Taxonomy API ---------------- -.. automodule:: playground_plums.commons +.. automodule:: plums.commons :members: Taxonomy :undoc-members: :exclude-members: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z @@ -25,7 +25,7 @@ The Taxonomy API :show-inheritance: :member-order: bysource -.. automodule:: playground_plums.commons +.. automodule:: plums.commons :members: Label :undoc-members: :exclude-members: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z @@ -36,7 +36,7 @@ The Taxonomy API Trees helper classes -------------------- -.. automodule:: playground_plums.commons +.. automodule:: plums.commons :members: Tree :undoc-members: :exclude-members: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z @@ -47,7 +47,7 @@ Trees helper classes Taxonomies iterators .................... -.. automodule:: playground_plums.commons.data.taxonomy.iterator +.. automodule:: plums.commons.data.taxonomy.iterator :members: :undoc-members: :exclude-members: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z @@ -58,7 +58,7 @@ Taxonomies iterators Taxonomies accessors .................... -.. automodule:: playground_plums.commons.data.taxonomy.accessor +.. automodule:: plums.commons.data.taxonomy.accessor :members: :undoc-members: :exclude-members: a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z diff --git a/docs/source/api_doc/plums.commons.path.rst b/docs/source/api_doc/plums.commons.path.rst index fd1e9f5..27a3ae8 100755 --- a/docs/source/api_doc/plums.commons.path.rst +++ b/docs/source/api_doc/plums.commons.path.rst @@ -6,7 +6,7 @@ The |Path| class implements a subset of :mod:`pathlib` functionality and few additional ones. It is designed to integrate seamlessly with :mod:`pathlib` with efficient conversions. -.. automodule:: playground_plums.commons +.. automodule:: plums.commons :members: Path :special-members: __add__, __radd__, __contains__, __eq__ :undoc-members: diff --git a/docs/source/api_doc/plums.dataflow.dataset.rst b/docs/source/api_doc/plums.dataflow.dataset.rst index 2ca0955..d401354 100644 --- a/docs/source/api_doc/plums.dataflow.dataset.rst +++ b/docs/source/api_doc/plums.dataflow.dataset.rst @@ -12,14 +12,14 @@ Base datasets The main class to stream through data in Plums is the |Dataset| base class, which guarantee a sequence-like interface to manipulate data in an ordered fashion. -.. autoclass:: playground_plums.dataflow.dataset.Dataset +.. autoclass:: plums.dataflow.dataset.Dataset :members: :special-members: __getitem__ :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.dataflow.dataset.SizedDataset +.. autoclass:: plums.dataflow.dataset.SizedDataset :members: :special-members: __getitem__, __add__, __len__ :undoc-members: @@ -28,14 +28,14 @@ interface to manipulate data in an ordered fashion. Two utility |Dataset| classes are also provided to ease the creation of dataset partitions and compositions: -.. autoclass:: playground_plums.dataflow.dataset.Subset +.. autoclass:: plums.dataflow.dataset.Subset :members: :special-members: __getitem__, __len__ :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.dataflow.dataset.ConcatDataset +.. autoclass:: plums.dataflow.dataset.ConcatDataset :members: :special-members: __getitem__, __len__ :undoc-members: @@ -45,7 +45,7 @@ Two utility |Dataset| classes are also provided to ease the creation of dataset Pattern dataset --------------- -.. autoclass:: playground_plums.dataflow.dataset.PatternDataset +.. autoclass:: plums.dataflow.dataset.PatternDataset :members: :special-members: __getitem__, __len__ :undoc-members: @@ -60,28 +60,28 @@ The following datasets are domain-specific datasets based on the |PatternDataset Playground ++++++++++ -.. autoclass:: playground_plums.dataflow.dataset.PlaygroundDataset +.. autoclass:: plums.dataflow.dataset.PlaygroundDataset :members: :special-members: __getitem__, __len__ :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.dataflow.dataset.playground.TileDriver +.. autoclass:: plums.dataflow.dataset.playground.TileDriver :members: :special-members: __call__ :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.dataflow.dataset.playground.AnnotationDriver +.. autoclass:: plums.dataflow.dataset.playground.AnnotationDriver :members: :special-members: __call__ :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.dataflow.dataset.playground.TaxonomyReader +.. autoclass:: plums.dataflow.dataset.playground.TaxonomyReader :members: :special-members: __call__ :undoc-members: diff --git a/docs/source/api_doc/plums.dataflow.io.rst b/docs/source/api_doc/plums.dataflow.io.rst index fca32cf..b385fb0 100644 --- a/docs/source/api_doc/plums.dataflow.io.rst +++ b/docs/source/api_doc/plums.dataflow.io.rst @@ -18,13 +18,13 @@ As of now, the list of explicitly supported |ptype| is: |RGB|, |BGR|, |RGBA|, |B Additional |ptype| may be created on the fly as long as they references existing channels. -.. autoclass:: playground_plums.dataflow.io.Tile +.. autoclass:: plums.dataflow.io.Tile :members: :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.dataflow.io.ptype +.. autoclass:: plums.dataflow.io.ptype :members: :special-members: __eq__, __contains__ :undoc-members: @@ -44,7 +44,7 @@ The use ordering is expected to reflect loading speed however, because the relat dependent on data, it is recommended to benchmark all library for specific use-cases to select the best possible backend. -.. automodule:: playground_plums.dataflow.io.json +.. automodule:: plums.dataflow.io.json :members: :undoc-members: :show-inheritance: diff --git a/docs/source/api_doc/plums.model.developer.rst b/docs/source/api_doc/plums.model.developer.rst index e309e10..af61272 100644 --- a/docs/source/api_doc/plums.model.developer.rst +++ b/docs/source/api_doc/plums.model.developer.rst @@ -17,14 +17,14 @@ because it should not be used directly by end-users or model producers/consumers Producer version handling ------------------------- -.. automodule:: playground_plums.model.components.version +.. automodule:: plums.model.components.version :members: version, register :undoc-members: :special-members: __eq__, __lt__, __str__ :show-inheritance: :member-order: bysource -.. automodule:: playground_plums.model.components.version +.. automodule:: plums.model.components.version :members: Version, PyPA :undoc-members: :special-members: __eq__, __lt__, __str__ @@ -34,13 +34,13 @@ Producer version handling Utils ----- -.. automodule:: playground_plums.model.components.utils +.. automodule:: plums.model.components.utils :members: is_duplicate, copy, rmtree :undoc-members: :show-inheritance: :member-order: bysource -.. automodule:: playground_plums.model.components.utils +.. automodule:: plums.model.components.utils :members: TrainingStatus :undoc-members: :show-inheritance: diff --git a/docs/source/api_doc/plums.model.rst b/docs/source/api_doc/plums.model.rst index 357efc8..1ce99c6 100644 --- a/docs/source/api_doc/plums.model.rst +++ b/docs/source/api_doc/plums.model.rst @@ -12,7 +12,7 @@ objects like |Training|, |Producer|, |CheckpointCollection| and |Checkpoint|. .. seealso:: The :ref:`model_dev` for more information on the |Model| API inner workings. -.. automodule:: playground_plums.model.model +.. automodule:: plums.model.model :members: Model :undoc-members: :show-inheritance: @@ -21,20 +21,20 @@ objects like |Training|, |Producer|, |CheckpointCollection| and |Checkpoint|. Components ---------- -.. automodule:: playground_plums.model.model +.. automodule:: plums.model.model :members: initialisation :undoc-members: :show-inheritance: :member-order: bysource -.. automodule:: playground_plums.model.components.components +.. automodule:: plums.model.components.components :members: :special-members: __eq__ :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.model.components.utils.Checkpoint +.. autoclass:: plums.model.components.utils.Checkpoint :members: :special-members: __eq__, __hash__ :undoc-members: @@ -44,7 +44,7 @@ Components Exceptions ---------- -.. automodule:: playground_plums.model.exception +.. automodule:: plums.model.exception :members: :undoc-members: :show-inheritance: diff --git a/docs/source/api_doc/plums.model.validation.rst b/docs/source/api_doc/plums.model.validation.rst index cdbacb0..b26dcc3 100644 --- a/docs/source/api_doc/plums.model.validation.rst +++ b/docs/source/api_doc/plums.model.validation.rst @@ -6,7 +6,7 @@ Most **P**\ lums **M**\ odel **F**\ ormat validation is performed with the |validate| function, which take in a |Path| and returns the validated model *metadata* or raises a :exc:`PlumsValidationError`. -.. automodule:: playground_plums.model.validation +.. automodule:: plums.model.validation :members: :undoc-members: :show-inheritance: @@ -30,7 +30,7 @@ PMF data tree validation API You may find here the list of |TreeComponent| compositing the :ref:`structure` schema. -.. automodule:: playground_plums.model.validation.structure +.. automodule:: plums.model.validation.structure :members: :undoc-members: :exclude-members: TreeComponent, DefaultTree @@ -42,7 +42,7 @@ Metadata validation API You may find here the list of |MetadataComponent| compositing the :ref:`metadata` schema. -.. automodule:: playground_plums.model.validation.metadata +.. automodule:: plums.model.validation.metadata :members: :undoc-members: :exclude-members: MetadataComponent, DefaultMetadata @@ -52,20 +52,20 @@ You may find here the list of |MetadataComponent| compositing the :ref:`metadata Core validation API ....................... -.. automodule:: playground_plums.model.validation.schema_core +.. automodule:: plums.model.validation.schema_core :members: :undoc-members: :show-inheritance: :member-order: bysource -.. automodule:: playground_plums.model.validation.metadata +.. automodule:: plums.model.validation.metadata :members: MetadataComponent, DefaultMetadata :undoc-members: :exclude-members: :show-inheritance: :member-order: bysource -.. automodule:: playground_plums.model.validation.structure +.. automodule:: plums.model.validation.structure :members: TreeComponent, DefaultTree :undoc-members: :exclude-members: @@ -75,19 +75,19 @@ Core validation API Helper functions ................ -.. automodule:: playground_plums.model.validation.utils.dict_from_tree +.. automodule:: plums.model.validation.utils.dict_from_tree :members: :undoc-members: :show-inheritance: :member-order: bysource -.. automodule:: playground_plums.model.validation.utils.checksum +.. automodule:: plums.model.validation.utils.checksum :members: :undoc-members: :show-inheritance: :member-order: bysource -.. automodule:: playground_plums.model.validation.utils.validate_path +.. automodule:: plums.model.validation.utils.validate_path :members: :undoc-members: :show-inheritance: diff --git a/docs/source/api_doc/plums.plot.color.colormap.rst b/docs/source/api_doc/plums.plot.color.colormap.rst index b5af836..a70e874 100644 --- a/docs/source/api_doc/plums.plot.color.colormap.rst +++ b/docs/source/api_doc/plums.plot.color.colormap.rst @@ -13,13 +13,13 @@ The way colors are handled in Plums **plot** depends on the high-level `Colorspacious `_ color handling library and the |Color| class is a simple container class which delegates all the heavy lifting to *colorspacious*. -It offers a typed handling of colors and introduces the concept of :attr:`~playground_plums.plot.engine.Color.ctype` which +It offers a typed handling of colors and introduces the concept of :attr:`~plums.plot.engine.Color.ctype` which represents a color space in which a |Color| instances live, and thus indicates how its -:attr:`~playground_plums.plot.engine.Color.components` should be interpreted. +:attr:`~plums.plot.engine.Color.components` should be interpreted. Internally, the actual |Color| components are stored in the limited but highly common ``sRGB255`` space. -.. autoclass:: playground_plums.plot.engine.Color(*components, ctype='sRGB255') +.. autoclass:: plums.plot.engine.Color(*components, ctype='sRGB255') :members: :special-members: __eq__, __add__, __mul__, __sub__, __array_interface__ :undoc-members: @@ -35,7 +35,7 @@ A |ColorMap| performs a link between a set :math:`\mathcal{V} \subset \mathbb{R} Note that both sets might be infinite, in which case we construct a |ContinuousColorMap|, or finite, in which case we construct a |DiscreteColorMap|. -.. autoclass:: playground_plums.plot.engine.ColorMap +.. autoclass:: plums.plot.engine.ColorMap :members: _get_color, get_color, __call__ :special-members: __call__ :undoc-members: @@ -46,7 +46,7 @@ Constructor classes ................... -.. automodule:: playground_plums.plot.engine +.. automodule:: plums.plot.engine :members: ContinuousColorMap, DiscreteColorMap :undoc-members: :show-inheritance: @@ -55,7 +55,7 @@ Constructor classes Concrete color maps classes ........................... -.. automodule:: playground_plums.plot.engine +.. automodule:: plums.plot.engine :members: CircularColorMap, SemiCircularColorMap, LightnessColorMap, KeyPointsColorMap, CategoricalColorMap :undoc-members: :show-inheritance: diff --git a/docs/source/api_doc/plums.plot.compositor.rst b/docs/source/api_doc/plums.plot.compositor.rst index c904116..5d71146 100644 --- a/docs/source/api_doc/plums.plot.compositor.rst +++ b/docs/source/api_doc/plums.plot.compositor.rst @@ -17,13 +17,13 @@ Moreover, you can decorate your final composition by adding a title on top of it The actual **compositor** API is exposed here. -.. automodule:: playground_plums.plot.engine.compositor +.. automodule:: plums.plot.engine.compositor :members: CompositorBase :undoc-members: :show-inheritance: :member-order: bysource -.. automodule:: playground_plums.plot.engine +.. automodule:: plums.plot.engine :members: Compositor :undoc-members: :show-inheritance: diff --git a/docs/source/api_doc/plums.plot.descriptor.dev.rst b/docs/source/api_doc/plums.plot.descriptor.dev.rst index 32677f0..54746c8 100644 --- a/docs/source/api_doc/plums.plot.descriptor.dev.rst +++ b/docs/source/api_doc/plums.plot.descriptor.dev.rst @@ -7,7 +7,7 @@ A |Descriptor| is a special kind of object which takes in one or many |RecordCollection|, and output one or many |RecordCollection| where each enclosed |Record| have an additional -:attr:`property <~playground_plums.commons.data_model.PropertyContainer.properties>`. +:attr:`property <~plums.commons.data_model.PropertyContainer.properties>`. The developer API exposes the abstract base class for all descriptors which indicates necessary interfaces to implement to construct a valid |Descriptor|. @@ -18,20 +18,20 @@ It also exposes two special kinds of |Descriptor|: property which contains the |Color| used to plot a |Record| from one or two |Descriptor|. * The |ByCategoryDescriptor| which wraps a |Descriptor| to make it dependent on a monitored property in |Record|. -.. autoclass:: playground_plums.plot.engine.Descriptor +.. autoclass:: plums.plot.engine.Descriptor :members: property_name, __descriptor__, __eq__, update, compute, reset, _make_interface :special-members: __eq__, __descriptor__ :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.plot.engine.color_engine.ByCategoryDescriptor +.. autoclass:: plums.plot.engine.color_engine.ByCategoryDescriptor :members: :undoc-members: :show-inheritance: :member-order: bysource -.. autoclass:: playground_plums.plot.engine.color_engine.ColorEngine +.. autoclass:: plums.plot.engine.color_engine.ColorEngine :members: :undoc-members: :show-inheritance: diff --git a/docs/source/api_doc/plums.plot.descriptor.user.rst b/docs/source/api_doc/plums.plot.descriptor.user.rst index 0a74982..438d974 100644 --- a/docs/source/api_doc/plums.plot.descriptor.user.rst +++ b/docs/source/api_doc/plums.plot.descriptor.user.rst @@ -5,13 +5,13 @@ A |Descriptor| is a special kind of object which takes in one or many |RecordCollection|, and output one or many |RecordCollection| where each enclosed |Record| have an additional -:attr:`property <~playground_plums.commons.data_model.PropertyContainer.properties>`. +:attr:`property <~plums.commons.data_model.PropertyContainer.properties>`. -Each |Descriptor| defines a specific :attr:`property <~playground_plums.commons.data_model.PropertyContainer.properties>` +Each |Descriptor| defines a specific :attr:`property <~plums.commons.data_model.PropertyContainer.properties>` (*i.e.* how to construct it from a |Record| and how to interpret the result) and can be used as a high level API to summarise a |Record| information or set of information in an enclosed highly semantic pattern. -Because each :attr:`descriptor property <~playground_plums.commons.data_model.PropertyContainer.properties>` is added to a +Because each :attr:`descriptor property <~plums.commons.data_model.PropertyContainer.properties>` is added to a |Record|, |Descriptor| may be chained to generate arbitrary sequences of description processing. A collection of generic |Descriptor| are already included in Plums *plot*, but extending the base API is easy by @@ -23,7 +23,7 @@ creating new |Descriptor| classes. Specific descriptors -------------------- -.. automodule:: playground_plums.plot +.. automodule:: plums.plot :members: Labels, Confidence, IntervalConfidence, Area, IntervalArea :undoc-members: :show-inheritance: @@ -33,7 +33,7 @@ Specific descriptors Generic descriptors ------------------- -.. automodule:: playground_plums.plot +.. automodule:: plums.plot :members: CategoricalDescriptor, ContinuousDescriptor, IntervalDescriptor :undoc-members: :show-inheritance: diff --git a/docs/source/api_doc/plums.plot.legend_painter.rst b/docs/source/api_doc/plums.plot.legend_painter.rst index a8a8aab..acbe08f 100644 --- a/docs/source/api_doc/plums.plot.legend_painter.rst +++ b/docs/source/api_doc/plums.plot.legend_painter.rst @@ -18,7 +18,7 @@ optionally confidence). The actual legend API is exposed here. -.. automodule:: playground_plums.plot.engine.legend_painter +.. automodule:: plums.plot.engine.legend_painter :members: :undoc-members: :show-inheritance: diff --git a/docs/source/api_doc/plums.plot.orchestrator.rst b/docs/source/api_doc/plums.plot.orchestrator.rst index 7f403c1..b0b039e 100644 --- a/docs/source/api_doc/plums.plot.orchestrator.rst +++ b/docs/source/api_doc/plums.plot.orchestrator.rst @@ -16,13 +16,13 @@ The |Orchestrator| is highly customizable, and different layouts of the mosaic c mosaic will correspond to a row of that array (the row being generally of different lengths). -.. automodule:: playground_plums.plot.engine +.. automodule:: plums.plot.engine :members: Orchestrator :undoc-members: :show-inheritance: :member-order: bysource -.. automodule:: playground_plums.plot.engine.orchestrator +.. automodule:: plums.plot.engine.orchestrator :members: OrchestratorBase :undoc-members: :show-inheritance: diff --git a/docs/source/api_doc/plums.plot.painter.rst b/docs/source/api_doc/plums.plot.painter.rst index 4ac8d5c..beed4dc 100644 --- a/docs/source/api_doc/plums.plot.painter.rst +++ b/docs/source/api_doc/plums.plot.painter.rst @@ -5,13 +5,13 @@ The actual **painter** composition is exposed here. -.. automodule:: playground_plums.plot.engine.painter +.. automodule:: plums.plot.engine.painter :members: PainterBase :undoc-members: :show-inheritance: :member-order: bysource -.. automodule:: playground_plums.plot.engine +.. automodule:: plums.plot.engine :members: Painter :undoc-members: :show-inheritance: diff --git a/docs/source/api_doc/plums.plot.plot.rst b/docs/source/api_doc/plums.plot.plot.rst index c6c2ce7..3fb2910 100644 --- a/docs/source/api_doc/plums.plot.plot.rst +++ b/docs/source/api_doc/plums.plot.plot.rst @@ -20,13 +20,13 @@ used by end-users. It indicates which interfaces and attributes one should expec one *porcelain interface* behaviour may significantly differ from another, one should read each class documentation individually rather than relying on the |Plot| to assume subclasses behaviour. -.. automodule:: playground_plums.plot +.. automodule:: plums.plot :members: Plot :undoc-members: :show-inheritance: :member-order: bysource -.. automodule:: playground_plums.plot +.. automodule:: plums.plot :members: StandardPlot, PairPlot :undoc-members: :show-inheritance: diff --git a/docs/source/content/dataflow/dataset.rst b/docs/source/content/dataflow/dataset.rst index e78a43e..d0b04bd 100644 --- a/docs/source/content/dataflow/dataset.rst +++ b/docs/source/content/dataflow/dataset.rst @@ -119,7 +119,7 @@ We can then create our dataset by instantiating a |PatternDataset| with the *pat .. code-block:: python - from playground_plums.dataflow.dataset import PatternDataset + from plums.dataflow.dataset import PatternDataset dataset = \ PatternDataset(tile_pattern='datasets/{dataset_id}/samples/{zone_id}/{image_id}/{sample_id}.jpg', annotation_pattern='datasets/{dataset_id}/labels/{zone_id}/{sample_id}.jpg', @@ -154,7 +154,7 @@ dataflow: .. code-block:: python - from playground_plums.dataflow.io import Tile + from plums.dataflow.io import Tile def tile_driver(path_tuple, **matches): tiles = [Tile(path) for path in path_tuple] @@ -166,7 +166,7 @@ data-model. For tiles, it must be an :class:`~collections.OrderedDict`-like enti .. code-block:: python from plus.commons.data import TileCollection - from playground_plums.dataflow.io import Tile + from plums.dataflow.io import Tile def tile_driver(path_tuple, **matches): tiles = [Tile(path) for path in path_tuple] @@ -184,8 +184,8 @@ We will discard the zone footprint mask in this example to keep it simple but we .. code-block:: python - from playground_plums.commons.data import Annotation, RecordCollection, Record - from playground_plums.dataflow.io import load + from plums.commons.data import Annotation, RecordCollection, Record + from plums.dataflow.io import load def annotation_driver(path_tuple, **matches): path = path_tuple[0] # We expected a single annotation JSON file @@ -218,9 +218,9 @@ seen before together: .. code-block:: python - from playground_plums.commons.data import Annotation, RecordCollection, Record, TileCollection - from playground_plums.dataflow.io import Tile, load - from playground_plums.dataflow.dataset import PatternDataset + from plums.commons.data import Annotation, RecordCollection, Record, TileCollection + from plums.dataflow.io import Tile, load + from plums.dataflow.dataset import PatternDataset def tile_driver_fn(path_tuple, **matches): tiles = [Tile(path) for path in path_tuple] diff --git a/docs/source/content/datamodel.rst b/docs/source/content/datamodel.rst index 58a0981..5764ee4 100755 --- a/docs/source/content/datamodel.rst +++ b/docs/source/content/datamodel.rst @@ -73,9 +73,9 @@ in the *data-model*. This serves both as a summary of the *data-model* and an ex +--------------------+-------------------------------------------------------------------+------------------------------------------------------------------+ | Class | Interfaces | Attributes | +====================+===================================================================+==================================================================+ -| |DataPoint| | :math:`\varnothing` | * :attr:`~playground_plums.commons.DataPoint.tile` | -| | | * :attr:`~playground_plums.commons.DataPoint.annotation` | -| | | * :attr:`~playground_plums.commons.DataPoint.properties` | +| |DataPoint| | :math:`\varnothing` | * :attr:`~plums.commons.DataPoint.tile` | +| | | * :attr:`~plums.commons.DataPoint.annotation` | +| | | * :attr:`~plums.commons.DataPoint.properties` | +--------------------+-------------------------------------------------------------------+------------------------------------------------------------------+ | |TileCollection| | * :meth:`~object.__getitem__` | | | | * :meth:`~object.__setitem__` | | @@ -83,39 +83,39 @@ in the *data-model*. This serves both as a summary of the *data-model* and an ex | | * :meth:`~object.__iter__` | | | | * :meth:`~object.__len__` | | +--------------------+-------------------------------------------------------------------+------------------------------------------------------------------+ -| |Tile| | * :data:`__array_interface__` | * :attr:`~playground_plums.commons.TileWrapper.filename` | -| | | * :attr:`~playground_plums.commons.TileWrapper.size` | -| | | * :attr:`~playground_plums.commons.TileWrapper.width` | -| | | * :attr:`~playground_plums.commons.TileWrapper.height` | -| | | * :attr:`~playground_plums.commons.TileWrapper.info` | +| |Tile| | * :data:`__array_interface__` | * :attr:`~plums.commons.TileWrapper.filename` | +| | | * :attr:`~plums.commons.TileWrapper.size` | +| | | * :attr:`~plums.commons.TileWrapper.width` | +| | | * :attr:`~plums.commons.TileWrapper.height` | +| | | * :attr:`~plums.commons.TileWrapper.info` | +--------------------+-------------------------------------------------------------------+------------------------------------------------------------------+ -| |Annotation| | * :data:`__geo_interface__` | * :attr:`~playground_plums.commons.Annotation.record_collection` | -| | | * :attr:`~playground_plums.commons.Annotation.mask_collection` | -| | | * :attr:`~playground_plums.commons.Annotation.properties` | +| |Annotation| | * :data:`__geo_interface__` | * :attr:`~plums.commons.Annotation.record_collection` | +| | | * :attr:`~plums.commons.Annotation.mask_collection` | +| | | * :attr:`~plums.commons.Annotation.properties` | +--------------------+-------------------------------------------------------------------+------------------------------------------------------------------+ -| |RecordCollection| | * :data:`__geo_interface__` | * :attr:`~playground_plums.commons.RecordCollection.id` | -| | * :meth:`~playground_plums.commons.RecordCollection.__getitem__` | * :attr:`~playground_plums.commons.RecordCollection.records` | -| | * :meth:`~playground_plums.commons.RecordCollection.__setitem__` | | -| | * :meth:`~playground_plums.commons.RecordCollection.__len__` | | -| | * :meth:`~playground_plums.commons.RecordCollection.append` | | -| | * :meth:`~playground_plums.commons.RecordCollection.to_geojson` | | +| |RecordCollection| | * :data:`__geo_interface__` | * :attr:`~plums.commons.RecordCollection.id` | +| | * :meth:`~plums.commons.RecordCollection.__getitem__` | * :attr:`~plums.commons.RecordCollection.records` | +| | * :meth:`~plums.commons.RecordCollection.__setitem__` | | +| | * :meth:`~plums.commons.RecordCollection.__len__` | | +| | * :meth:`~plums.commons.RecordCollection.append` | | +| | * :meth:`~plums.commons.RecordCollection.to_geojson` | | +--------------------+-------------------------------------------------------------------+------------------------------------------------------------------+ -| |Record| | * :data:`__geo_interface__` | * :attr:`~playground_plums.commons.Record.id` | -| | * :meth:`~playground_plums.commons.RecordCollection.to_geojson` | * :attr:`~playground_plums.commons.Record.labels` | -| | | * :attr:`~playground_plums.commons.Record.confidence` | -| | | * :attr:`~playground_plums.commons.Record.coordinates` | -| | | * :attr:`~playground_plums.commons.Record.type` | -| | | * :attr:`~playground_plums.commons.Record.properties` | +| |Record| | * :data:`__geo_interface__` | * :attr:`~plums.commons.Record.id` | +| | * :meth:`~plums.commons.RecordCollection.to_geojson` | * :attr:`~plums.commons.Record.labels` | +| | | * :attr:`~plums.commons.Record.confidence` | +| | | * :attr:`~plums.commons.Record.coordinates` | +| | | * :attr:`~plums.commons.Record.type` | +| | | * :attr:`~plums.commons.Record.properties` | +--------------------+-------------------------------------------------------------------+------------------------------------------------------------------+ -| |MaskCollection| | * :meth:`~playground_plums.commons.MaskCollection.__getitem__` | * :attr:`~playground_plums.commons.MaskCollection.masks` | +| |MaskCollection| | * :meth:`~plums.commons.MaskCollection.__getitem__` | * :attr:`~plums.commons.MaskCollection.masks` | +--------------------+-------------------------------------------------------------------+------------------------------------------------------------------+ -| |VectorMask| | * :data:`__geo_interface__` | * :attr:`~playground_plums.commons.VectorMask.name` | -| | * :meth:`~playground_plums.commons.VectorMask.to_geojson` | * :attr:`~playground_plums.commons.VectorMask.coordinates` | -| | | * :attr:`~playground_plums.commons.VectorMask.properties` | +| |VectorMask| | * :data:`__geo_interface__` | * :attr:`~plums.commons.VectorMask.name` | +| | * :meth:`~plums.commons.VectorMask.to_geojson` | * :attr:`~plums.commons.VectorMask.coordinates` | +| | | * :attr:`~plums.commons.VectorMask.properties` | +--------------------+-------------------------------------------------------------------+------------------------------------------------------------------+ -| |RasterMask| | * :data:`__array_interface__` | * :attr:`~playground_plums.commons.RasterMask.name` | -| | | * :attr:`~playground_plums.commons.RasterMask.size` | -| | | * :attr:`~playground_plums.commons.RasterMask.width` | -| | | * :attr:`~playground_plums.commons.RasterMask.height` | -| | | * :attr:`~playground_plums.commons.RasterMask.properties` | +| |RasterMask| | * :data:`__array_interface__` | * :attr:`~plums.commons.RasterMask.name` | +| | | * :attr:`~plums.commons.RasterMask.size` | +| | | * :attr:`~plums.commons.RasterMask.width` | +| | | * :attr:`~plums.commons.RasterMask.height` | +| | | * :attr:`~plums.commons.RasterMask.properties` | +--------------------+-------------------------------------------------------------------+------------------------------------------------------------------+ diff --git a/docs/source/content/getting_started.rst b/docs/source/content/getting_started.rst index 4544a5d..2277e51 100755 --- a/docs/source/content/getting_started.rst +++ b/docs/source/content/getting_started.rst @@ -33,7 +33,7 @@ Installation is simple with *PyPI* repository: .. code-block:: bash - pip install playground-plums + pip install plums What's next ? ------------- diff --git a/docs/source/content/model/plums_model_format.rst b/docs/source/content/model/plums_model_format.rst index a06ed3a..352baab 100644 --- a/docs/source/content/model/plums_model_format.rst +++ b/docs/source/content/model/plums_model_format.rst @@ -80,15 +80,15 @@ It is made of two sections: * The *PMF* format ``version``. * The *PMF* model |Producer| information *i.e.*: - * Its :attr:`~playground_plums.model.components.components.Producer.name` - * Its :attr:`~playground_plums.model.components.components.Producer.version` + * Its :attr:`~plums.model.components.components.Producer.name` + * Its :attr:`~plums.model.components.components.Producer.version` * A |ModelSchema| section which documents the stored *PMF* |Model| contents. The |ModelSchema| section is itself made of various metadata and two sections: -* The model :attr:`~playground_plums.model.model.Model.name`. -* The model :attr:`~playground_plums.model.model.Model.id`. +* The model :attr:`~plums.model.model.Model.name`. +* The model :attr:`~plums.model.model.Model.id`. * A |TrainingSchema| section which documents metadata on the model |Training| *i.e.*: * The training *status* (*i.e.* pending, running, failed or finished). @@ -100,8 +100,8 @@ The |ModelSchema| section is itself made of various metadata and two sections: * A |InitialisationSchema| section which document the model |initialisation|. The |CheckpointSchema| section is a mapping between a |Checkpoint| reference -(its :attr:`~playground_plums.model.components.utils.Checkpoint.name`) and its -:attr:`~playground_plums.model.components.utils.Checkpoint.epoch` and :attr:`~playground_plums.model.components.utils.Checkpoint.path`. That +(its :attr:`~plums.model.components.utils.Checkpoint.name`) and its +:attr:`~plums.model.components.utils.Checkpoint.epoch` and :attr:`~plums.model.components.utils.Checkpoint.path`. That is to say that each |Checkpoint| will be registered in the **metadata** as: .. code-block:: yaml diff --git a/docs/source/content/model/quickstart.rst b/docs/source/content/model/quickstart.rst index c728d1e..ea51501 100644 --- a/docs/source/content/model/quickstart.rst +++ b/docs/source/content/model/quickstart.rst @@ -5,13 +5,13 @@ Quickstart .. include:: ../../include.rst -Before it lives in a filesystem, a *PMF* |Model| lives in the *Python* realm through the ``playground_plums.model`` *python* API. +Before it lives in a filesystem, a *PMF* |Model| lives in the *Python* realm through the ``plums.model`` *python* API. Creating a *python* |Model| is a simple process: .. code-block:: python - from playground_plums.model import Model + from plums.model import Model model = Model('some_producer', 'py_pa', '1.0.1', 'some_model_name', @@ -25,7 +25,7 @@ Note that to create a |Model|, we need to know 5 things: internally as a |Producer|, along with the configuration path. * The configuration path: It is a |Path| to the configuration file used to configure the |Producer| to train the |Model|. It is stored internally inside the |Producer| class as the - :attr:`~playground_plums.model.components.components.Producer.configuration` attribute. + :attr:`~plums.model.components.components.Producer.configuration` attribute. * The model name and unique identifier: as :class:`str`. * Its ``build_parameters`` (here an empty dictionary): a :class:`dict` storing any relevant parameter that a particular :term:`producer` might want to pass on to eventual :term:`consumer` opening the |Model|. @@ -56,7 +56,7 @@ Similarly, registering a model |Checkpoint| has several possible interfaces: .. code-block:: python - from playground_plums.model import Checkpoint + from plums.model import Checkpoint checkpoint = Checkpoint(name='some_reference', path='a/path/to/a/checkpoint_file.model', @@ -73,14 +73,14 @@ Similarly, registering a model |Checkpoint| has several possible interfaces: model.checkpoint_collection[checkpoint.name] = checkpoint .. warning:: - Registering a |Checkpoint| with an :attr:`~playground_plums.model.components.utils.Checkpoint.epoch` stricly superior to the - |Training| :attr:`~playground_plums.model.components.components.Training.latest_epoch` without registering a new latest epoch + Registering a |Checkpoint| with an :attr:`~plums.model.components.utils.Checkpoint.epoch` stricly superior to the + |Training| :attr:`~plums.model.components.components.Training.latest_epoch` without registering a new latest epoch will result in a invalid *PMF* model when saved on disk. - Generally speaking, the :meth:`~playground_plums.model.model.Model.save` operation is performed lazily with no prior validation + Generally speaking, the :meth:`~plums.model.model.Model.save` operation is performed lazily with no prior validation step and it is up to the user to ensure that the implemented |Model| life-cycle does result in a valid model. -Accessing the ``model`` initialisation is done through the :attr:`~playground_plums.model.model.Model.initialisation` attribute +Accessing the ``model`` initialisation is done through the :attr:`~plums.model.model.Model.initialisation` attribute which might either be ``None``, a |Model| instance or a |Checkpoint| depending on the initialisation type. Registering an initialisation is simple: @@ -93,16 +93,16 @@ Registering an initialisation is simple: # For a checkpoint initialisation model.register_initialisation('an/initialisation/path', name='some_name') -Saving a |Model| to disk is done through the :meth:`~playground_plums.model.model.Model.save` method: +Saving a |Model| to disk is done through the :meth:`~plums.model.model.Model.save` method: .. code-block:: python model.save('a/destination/path') -Similarly, loading a saved |Model| from disk can be done with the :meth:`~playground_plums.model.model.Model.load` class method: +Similarly, loading a saved |Model| from disk can be done with the :meth:`~plums.model.model.Model.load` class method: .. code-block:: python - from playground_plums.model import Model + from plums.model import Model model = Model.load('a/source/path') diff --git a/docs/source/content/plot/descriptor.rst b/docs/source/content/plot/descriptor.rst index 917b3df..e4c5ab4 100644 --- a/docs/source/content/plot/descriptor.rst +++ b/docs/source/content/plot/descriptor.rst @@ -8,7 +8,7 @@ Descriptor API The *Descriptor API* is one of the main component of the Plums *plot* user interface. A |Descriptor| is a component which *describes* a set of |Record| by adding special *attributes* -(actually :attr:`~playground_plums.commons.record.Record.properties`) which, when coupled with the |Descriptor| *schema*, +(actually :attr:`~plums.commons.record.Record.properties`) which, when coupled with the |Descriptor| *schema*, allows external components to get personalized data on a |Record| in a unified manner and without any prior on the |Record| content. @@ -17,11 +17,11 @@ allows external components to get personalized data on a |Record| in a unified m A |Descriptor| is made of 3 parts: -* An :meth:`~playground_plums.plot.descriptor.Descriptor.update` method which updates internal values given a collection +* An :meth:`~plums.plot.descriptor.Descriptor.update` method which updates internal values given a collection of |RecordCollection|. -* A :meth:`~playground_plums.plot.descriptor.Descriptor.compute` method which writes special *description* properties on +* A :meth:`~plums.plot.descriptor.Descriptor.compute` method which writes special *description* properties on |Record| in a collection of |RecordCollection| according to the previously accumulated internal values. -* A :meth:`~playground_plums.plot.descriptor.Descriptor.__descriptor__` attribute which exposes pointers on how to +* A :meth:`~plums.plot.descriptor.Descriptor.__descriptor__` attribute which exposes pointers on how to decode the written out *description* properties. There are 2 types of descriptor: @@ -46,7 +46,7 @@ Let us consider the following |RecordCollection| to be plot: .. code-block:: python - from playground_plums.commons.data import RecordCollection, Record + from plums.commons.data import RecordCollection, Record # Create records records = [ @@ -87,7 +87,7 @@ Let us consider the following |RecordCollection| to be plot: The built-in collection of |Descriptor| already allows to select the *main color* according to each |Record|'s |Area|, |Labels| or |Confidence|, but what if we wanted to select the *main color* according to the first -:attr:`~playground_plums.commons.record.Record.labels` *first letter* ? +:attr:`~plums.commons.record.Record.labels` *first letter* ? The solution is to create a new *tailor-made* descriptor to handle the task and pass the result to the |ColorEngine| to use. @@ -101,7 +101,7 @@ of machinery already laid out. .. code-block:: python - from playground_plums.plot.descriptor import Descriptor + from plums.plot.descriptor import Descriptor class Letter(Descriptor): def __init__(self): @@ -170,7 +170,7 @@ Let's break it down: self._max = -0.5 super(Letter, self).__init__(name='letter') -* We then need to override the :meth:`~playground_plums.plot.descriptor.Descriptor.update` method which will update these +* We then need to override the :meth:`~plums.plot.descriptor.Descriptor.update` method which will update these internal attributes according to the letters encountered in each |RecordCollection|: .. code-block:: python @@ -188,7 +188,7 @@ Let's break it down: self._letters.append(letter) self._indices.append(self._max) -* Following from there, we also override the :meth:`~playground_plums.plot.descriptor.Descriptor.compute` method which does +* Following from there, we also override the :meth:`~plums.plot.descriptor.Descriptor.compute` method which does the inverse mapping and adds an index according to the letters found in each |RecordCollection|: .. code-block:: python @@ -208,7 +208,7 @@ Let's break it down: return record_collections * Last but not least, we construct the corresponding - :attr:`~playground_plums.plot.descriptor.Descriptor.__descriptor__` with the + :attr:`~plums.plot.descriptor.Descriptor.__descriptor__` with the :meth:`_make_interface` private method: .. code-block:: python diff --git a/docs/source/content/plot/quickstart.rst b/docs/source/content/plot/quickstart.rst index 733a200..f9b539d 100644 --- a/docs/source/content/plot/quickstart.rst +++ b/docs/source/content/plot/quickstart.rst @@ -16,24 +16,24 @@ In this QuickStart, we will use the following image: *Plums* plot uses two components to create figures, the |StandardPlot| or the |PairPlot| interfaces (which all behave in a similar fashion: one accumulates |DataPoint|-like elements with -:meth:`~playground_plums.plot.plot.Plot.add` and aggregates them into a single figure with -:meth:`~playground_plums.plot.plot.Plot.plot`), and the :ref:`descriptor`. +:meth:`~plums.plot.plot.Plot.add` and aggregates them into a single figure with +:meth:`~plums.plot.plot.Plot.plot`), and the :ref:`descriptor`. Each *Plot* class has slight differences: * |StandardPlot| takes a |Tile| and a single |RecordCollection| for each - :meth:`~playground_plums.plot.plot.StandardPlot.add` call. + :meth:`~plums.plot.plot.StandardPlot.add` call. * |PairPlot| takes a |Tile| and a pair of |RecordCollection| (implicitly interpreted as *predictions* - and *ground-truths* respectively) for each :meth:`~playground_plums.plot.plot.StandardPlot.add` call. + and *ground-truths* respectively) for each :meth:`~plums.plot.plot.StandardPlot.add` call. .. code-block:: python import numpy as np import PIL.Image - import playground_plums.commons.data as data - from playground_plums.plot.plot import StandardPlot, PairPlot - from playground_plums.plot.descriptor import Labels, Confidence + import plums.commons.data as data + from plums.plot.plot import StandardPlot, PairPlot + from plums.plot.descriptor import Labels, Confidence # Make the prediction record collection records = [ @@ -112,7 +112,7 @@ to store them in a |RecordCollection| as predictions or ground truths. .. code-block:: python - import playground_plums.commons.data as data + import plums.commons.data as data records = [ data.Record( @@ -159,7 +159,7 @@ Then, we need to open and instantiate the |Tile| with the image: import numpy as np import PIL.Image - import playground_plums.commons.data as data + import plums.commons.data as data tile = PIL.Image.open('image.png') @@ -173,13 +173,13 @@ The |StandardPlot| will compose a figure by painting each record contained in th It can use one or two descriptors to classify the objects contained in a |RecordCollection|. In this example, we use |Labels| as first descriptor which is used to extract the -:attr:`~playground_plums.commons.data.record.Record.labels` from +:attr:`~plums.commons.data.record.Record.labels` from each |Record| and the |Confidence| as secondary descriptor which is used to extract their -:attr:`~playground_plums.commons.data.record.Record.confidence` property. +:attr:`~plums.commons.data.record.Record.confidence` property. .. code-block:: python - from playground_plums.plot.plot import StandardPlot + from plums.plot.plot import StandardPlot plot = StandardPlot(Labels(), secondary_descriptor=Confidence(), @@ -214,7 +214,7 @@ different tiles. .. code-block:: python - from playground_plums.plot.plot import PairPlot + from plums.plot.plot import PairPlot plot_pair = PairPlot(secondary_descriptor=Labels(), title='PairPlot', diff --git a/docs/source/content/quickstart.rst b/docs/source/content/quickstart.rst index 2e317ef..86df9fd 100755 --- a/docs/source/content/quickstart.rst +++ b/docs/source/content/quickstart.rst @@ -18,8 +18,8 @@ which reference a |Taxonomy|: .. code-block:: python import numpy as np - from playground_plums.commons.data import DataPoint, Annotation, TileWrapper, RecordCollection, Record - from playground_plums.commons.data.taxonomy import Taxonomy, Label + from plums.commons.data import DataPoint, Annotation, TileWrapper, RecordCollection, Record + from plums.commons.data.taxonomy import Taxonomy, Label # Make a taxonomy breakfast = Label('breakfast item') @@ -66,7 +66,7 @@ The first step would be to construct a |Taxonomy| using the :ref:`Taxonomy API < .. code-block:: python - from playground_plums.commons.data.taxonomy import Taxonomy, Label + from plums.commons.data.taxonomy import Taxonomy, Label breakfast = Label('breakfast item') eggs = Label('eggs', parent=breakfast) @@ -116,7 +116,7 @@ The next step is to create a bunch of |Record| and to store them in a |RecordCol .. code-block:: python - from playground_plums.commons.data import RecordCollection, Record + from plums.commons.data import RecordCollection, Record first = Record([[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]], ('eggs', )) second = Record([[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]], ('bacon', )) @@ -203,7 +203,7 @@ We have to build an |Annotation| from our |RecordCollection|: .. code-block:: python - from playground_plums.commons.data import Annotation + from plums.commons.data import Annotation annotation = Annotation(record_collection) @@ -212,7 +212,7 @@ Then we will build a dummy empty |Tile| with numpy and the |TileWrapper| util cl .. code-block:: python import numpy as np - from playground_plums.commons.data import TileWrapper + from plums.commons.data import TileWrapper tile = TileWrapper(np.zeros((100, 100, 3))) @@ -220,6 +220,6 @@ A |DataPoint| is a *container class* for a |Tile|, |Annotation| couple, which is .. code-block:: python - from playground_plums.commons.data import DataPoint + from plums.commons.data import DataPoint data_point = DataPoint(tile, annotation) diff --git a/docs/source/include.rst b/docs/source/include.rst index 27a5a38..bc00850 100755 --- a/docs/source/include.rst +++ b/docs/source/include.rst @@ -44,168 +44,168 @@ .. Classes substitutions for commons: ================================== -.. |Path| replace:: :class:`~playground_plums.commons.Path` +.. |Path| replace:: :class:`~plums.commons.Path` -.. |TileCollection| replace:: :class:`~playground_plums.commons.TileCollection` -.. |Tile| replace:: :class:`~playground_plums.commons.Tile` -.. |TileWrapper| replace:: :class:`~playground_plums.commons.TileWrapper` +.. |TileCollection| replace:: :class:`~plums.commons.TileCollection` +.. |Tile| replace:: :class:`~plums.commons.Tile` +.. |TileWrapper| replace:: :class:`~plums.commons.TileWrapper` -.. |DataPoint| replace:: :class:`~playground_plums.commons.DataPoint` -.. |Annotation| replace:: :class:`~playground_plums.commons.Annotation` +.. |DataPoint| replace:: :class:`~plums.commons.DataPoint` +.. |Annotation| replace:: :class:`~plums.commons.Annotation` -.. |RasterMask| replace:: :class:`~playground_plums.commons.RasterMask` -.. |VectorMask| replace:: :class:`~playground_plums.commons.VectorMask` -.. |MaskCollection| replace:: :class:`~playground_plums.commons.MaskCollection` -.. |Mask| replace:: :class:`~playground_plums.commons.Mask` +.. |RasterMask| replace:: :class:`~plums.commons.RasterMask` +.. |VectorMask| replace:: :class:`~plums.commons.VectorMask` +.. |MaskCollection| replace:: :class:`~plums.commons.MaskCollection` +.. |Mask| replace:: :class:`~plums.commons.Mask` -.. |RecordCollection| replace:: :class:`~playground_plums.commons.RecordCollection` -.. |Record| replace:: :class:`~playground_plums.commons.Record` +.. |RecordCollection| replace:: :class:`~plums.commons.RecordCollection` +.. |Record| replace:: :class:`~plums.commons.Record` -.. |GeoInterfaced| replace:: :class:`~playground_plums.commons.data.GeoInterfaced` -.. |ArrayInterfaced| replace:: :class:`~playground_plums.commons.data.ArrayInterfaced` -.. |PropertyContainer| replace:: :class:`~playground_plums.commons.PropertyContainer` -.. |_Array| replace:: :class:`~playground_plums.commons.data.base._Array` +.. |GeoInterfaced| replace:: :class:`~plums.commons.data.GeoInterfaced` +.. |ArrayInterfaced| replace:: :class:`~plums.commons.data.ArrayInterfaced` +.. |PropertyContainer| replace:: :class:`~plums.commons.PropertyContainer` +.. |_Array| replace:: :class:`~plums.commons.data.base._Array` -.. |Taxonomy| replace:: :class:`~playground_plums.commons.Taxonomy` -.. |Tree| replace:: :class:`~playground_plums.commons.Tree` -.. |Label| replace:: :class:`~playground_plums.commons.Label` +.. |Taxonomy| replace:: :class:`~plums.commons.Taxonomy` +.. |Tree| replace:: :class:`~plums.commons.Tree` +.. |Label| replace:: :class:`~plums.commons.Label` -.. |TreeAccessorBase| replace:: :class:`~playground_plums.commons.data.taxonomy.accessor.TreeAccessorBase` -.. |NameTreeAccessor| replace:: :class:`~playground_plums.commons.data.taxonomy.accessor.NameTreeAccessor` -.. |IdTreeAccessor| replace:: :class:`~playground_plums.commons.data.taxonomy.accessor.IdTreeAccessor` -.. |DefaultTreeAccessor| replace:: :class:`~playground_plums.commons.data.taxonomy.accessor.DefaultTreeAccessor` +.. |TreeAccessorBase| replace:: :class:`~plums.commons.data.taxonomy.accessor.TreeAccessorBase` +.. |NameTreeAccessor| replace:: :class:`~plums.commons.data.taxonomy.accessor.NameTreeAccessor` +.. |IdTreeAccessor| replace:: :class:`~plums.commons.data.taxonomy.accessor.IdTreeAccessor` +.. |DefaultTreeAccessor| replace:: :class:`~plums.commons.data.taxonomy.accessor.DefaultTreeAccessor` -.. |TreeIteratorBase| replace:: :class:`~playground_plums.commons.data.taxonomy.iterator.TreeIteratorBase` -.. |TopDownTreeIterator| replace:: :class:`~playground_plums.commons.data.taxonomy.iterator.TopDownTreeIterator` -.. |BottomUpTreeIterator| replace:: :class:`~playground_plums.commons.data.taxonomy.iterator.BottomUpTreeIterator` -.. |FloorTreeIterator| replace:: :class:`~playground_plums.commons.data.taxonomy.iterator.FloorTreeIterator` -.. |TopDownDepthWiseTreeIterator| replace:: :class:`~playground_plums.commons.data.taxonomy.iterator.TopDownDepthWiseTreeIterator` -.. |BottomUpDepthWiseTreeIterator| replace:: :class:`~playground_plums.commons.data.taxonomy.iterator.BottomUpDepthWiseTreeIterator` -.. |DefaultTreeIterator| replace:: :class:`~playground_plums.commons.data.taxonomy.iterator.DefaultTreeIterator` +.. |TreeIteratorBase| replace:: :class:`~plums.commons.data.taxonomy.iterator.TreeIteratorBase` +.. |TopDownTreeIterator| replace:: :class:`~plums.commons.data.taxonomy.iterator.TopDownTreeIterator` +.. |BottomUpTreeIterator| replace:: :class:`~plums.commons.data.taxonomy.iterator.BottomUpTreeIterator` +.. |FloorTreeIterator| replace:: :class:`~plums.commons.data.taxonomy.iterator.FloorTreeIterator` +.. |TopDownDepthWiseTreeIterator| replace:: :class:`~plums.commons.data.taxonomy.iterator.TopDownDepthWiseTreeIterator` +.. |BottomUpDepthWiseTreeIterator| replace:: :class:`~plums.commons.data.taxonomy.iterator.BottomUpDepthWiseTreeIterator` +.. |DefaultTreeIterator| replace:: :class:`~plums.commons.data.taxonomy.iterator.DefaultTreeIterator` .. Classes substitutions for dataflow: ================================== -.. |TileIO| replace:: :class:`~playground_plums.dataflow.io.Tile` -.. |ptype| replace:: :class:`~playground_plums.dataflow.io.ptype` -.. |dump| replace:: :class:`~playground_plums.dataflow.io.json.dump` -.. |load| replace:: :class:`~playground_plums.dataflow.io.json.load` - -.. |Channel| replace:: :class:`~playground_plums.dataflow.io.tile._format.channel.Channel` -.. |RGB| replace:: :class:`~playground_plums.dataflow.io.RGB` -.. |RGBA| replace:: :class:`~playground_plums.dataflow.io.RGBA` -.. |BGR| replace:: :class:`~playground_plums.dataflow.io.BGR` -.. |BGRA| replace:: :class:`~playground_plums.dataflow.io.BGRA` -.. |GREY| replace:: :class:`~playground_plums.dataflow.io.GREY` - -.. |Dataset| replace:: :class:`~playground_plums.dataflow.dataset.Dataset` -.. |SizedDataset| replace:: :class:`~playground_plums.dataflow.dataset.SizedDataset` -.. |Subset| replace:: :class:`~playground_plums.dataflow.dataset.Subset` -.. |ConcatDataset| replace:: :class:`~playground_plums.dataflow.dataset.ConcatDataset` -.. |PatternDataset| replace:: :class:`~playground_plums.dataflow.dataset.PatternDataset` -.. |PlaygroundDataset| replace:: :class:`~playground_plums.dataflow.dataset.PlaygroundDataset` -.. |TileDriver| replace:: :class:`~playground_plums.dataflow.dataset.playground.TileDriver` -.. |AnnotationDriver| replace:: :class:`~playground_plums.dataflow.dataset.playground.AnnotationDriver` -.. |TaxonomyReader| replace:: :class:`~playground_plums.dataflow.dataset.playground.TaxonomyReader` +.. |TileIO| replace:: :class:`~plums.dataflow.io.Tile` +.. |ptype| replace:: :class:`~plums.dataflow.io.ptype` +.. |dump| replace:: :class:`~plums.dataflow.io.json.dump` +.. |load| replace:: :class:`~plums.dataflow.io.json.load` + +.. |Channel| replace:: :class:`~plums.dataflow.io.tile._format.channel.Channel` +.. |RGB| replace:: :class:`~plums.dataflow.io.RGB` +.. |RGBA| replace:: :class:`~plums.dataflow.io.RGBA` +.. |BGR| replace:: :class:`~plums.dataflow.io.BGR` +.. |BGRA| replace:: :class:`~plums.dataflow.io.BGRA` +.. |GREY| replace:: :class:`~plums.dataflow.io.GREY` + +.. |Dataset| replace:: :class:`~plums.dataflow.dataset.Dataset` +.. |SizedDataset| replace:: :class:`~plums.dataflow.dataset.SizedDataset` +.. |Subset| replace:: :class:`~plums.dataflow.dataset.Subset` +.. |ConcatDataset| replace:: :class:`~plums.dataflow.dataset.ConcatDataset` +.. |PatternDataset| replace:: :class:`~plums.dataflow.dataset.PatternDataset` +.. |PlaygroundDataset| replace:: :class:`~plums.dataflow.dataset.PlaygroundDataset` +.. |TileDriver| replace:: :class:`~plums.dataflow.dataset.playground.TileDriver` +.. |AnnotationDriver| replace:: :class:`~plums.dataflow.dataset.playground.AnnotationDriver` +.. |TaxonomyReader| replace:: :class:`~plums.dataflow.dataset.playground.TaxonomyReader` .. Classes substitutions for model: =============================== -.. |validate| replace:: :func:`~playground_plums.model.validation.validate` - -.. |md5_checksum| replace:: :func:`~playground_plums.model.validation.utils.checksum.md5_checksum` -.. |make_dict_structure_from_tree| replace:: :func:`~playground_plums.model.validation.utils.dict_from_tree.make_dict_structure_from_tree` -.. |is_pathname_valid| replace:: :func:`~playground_plums.model.validation.utils.validate_path.is_pathname_valid` - -.. |SchemaComponent| replace:: :class:`~playground_plums.model.validation.schema_core.SchemaComponent` -.. |Default| replace:: :class:`~playground_plums.model.validation.schema_core.Default` -.. |PathSchema| replace:: :class:`~playground_plums.model.validation.schema_core.Path` -.. |MD5Checksum| replace:: :class:`~playground_plums.model.validation.schema_core.MD5Checksum` - -.. |MetadataComponent| replace:: :class:`~playground_plums.model.validation.metadata.MetadataComponent` -.. |DefaultMetadata| replace:: :class:`~playground_plums.model.validation.metadata.DefaultMetadata` -.. |ProducerVersionSchema| replace:: :class:`~playground_plums.model.validation.metadata.ProducerVersion` -.. |ProducerSchema| replace:: :class:`~playground_plums.model.validation.metadata.Producer` -.. |FormatSchema| replace:: :class:`~playground_plums.model.validation.metadata.Format` -.. |CheckpointSchema| replace:: :class:`~playground_plums.model.validation.metadata.Checkpoint` -.. |TrainingSchema| replace:: :class:`~playground_plums.model.validation.metadata.Training` -.. |ConfigurationSchema| replace:: :class:`~playground_plums.model.validation.metadata.Configuration` -.. |InitialisationPathSchema| replace:: :class:`~playground_plums.model.validation.metadata.InitialisationPath` -.. |InitialisationPMFSchema| replace:: :class:`~playground_plums.model.validation.metadata.InitialisationPMF` -.. |InitialisationSchema| replace:: :class:`~playground_plums.model.validation.metadata.Initialisation` -.. |ModelSchema| replace:: :class:`~playground_plums.model.validation.metadata.Model` -.. |MetadataSchema| replace:: :class:`~playground_plums.model.validation.metadata.Metadata` - -.. |TreeComponent| replace:: :class:`~playground_plums.model.validation.structure.TreeComponent` -.. |DefaultTree| replace:: :class:`~playground_plums.model.validation.structure.DefaultTree` -.. |MetadataTree| replace:: :class:`~playground_plums.model.validation.structure.Metadata` - -.. |DataTree| replace:: :class:`~playground_plums.model.validation.structure.Data` -.. |CheckpointTree| replace:: :class:`~playground_plums.model.validation.structure.Checkpoint` -.. |InitialisationTree| replace:: :class:`~playground_plums.model.validation.structure.Initialisation` -.. |InitialisationPMFTree| replace:: :class:`~playground_plums.model.validation.structure.InitialisationPMF` -.. |InitialisationPathTree| replace:: :class:`~playground_plums.model.validation.structure.InitialisationPath` -.. |ModelTree| replace:: :class:`~playground_plums.model.validation.structure.Model` -.. |PathTree| replace:: :class:`~playground_plums.model.validation.structure.Path` - -.. |Model| replace:: :class:`~playground_plums.model.model.Model` - -.. |initialisation| replace:: :class:`~playground_plums.model.model.initialisation` -.. |Training| replace:: :class:`~playground_plums.model.components.components.Training` -.. |Producer| replace:: :class:`~playground_plums.model.components.components.Producer` -.. |CheckpointCollection| replace:: :class:`~playground_plums.model.components.components.CheckpointCollection` -.. |TrainingStatus| replace:: :class:`~playground_plums.model.components.utils.TrainingStatus` -.. |Checkpoint| replace:: :class:`~playground_plums.model.components.utils.Checkpoint` -.. |ProducerVersion| replace:: :class:`~playground_plums.model.components.version.Version` -.. |PyPaVersion| replace:: :class:`~playground_plums.model.components.version.PyPA` - -.. |version| replace:: :class:`~playground_plums.model.components.version.version` -.. |register| replace:: :class:`~playground_plums.model.components.version.register` -.. |is_duplicate| replace:: :class:`~playground_plums.model.components.utils.is_duplicate` -.. |copy| replace:: :class:`~playground_plums.model.components.utils.copy` -.. |rmtree| replace:: :class:`~playground_plums.model.components.utils.rmtree` +.. |validate| replace:: :func:`~plums.model.validation.validate` + +.. |md5_checksum| replace:: :func:`~plums.model.validation.utils.checksum.md5_checksum` +.. |make_dict_structure_from_tree| replace:: :func:`~plums.model.validation.utils.dict_from_tree.make_dict_structure_from_tree` +.. |is_pathname_valid| replace:: :func:`~plums.model.validation.utils.validate_path.is_pathname_valid` + +.. |SchemaComponent| replace:: :class:`~plums.model.validation.schema_core.SchemaComponent` +.. |Default| replace:: :class:`~plums.model.validation.schema_core.Default` +.. |PathSchema| replace:: :class:`~plums.model.validation.schema_core.Path` +.. |MD5Checksum| replace:: :class:`~plums.model.validation.schema_core.MD5Checksum` + +.. |MetadataComponent| replace:: :class:`~plums.model.validation.metadata.MetadataComponent` +.. |DefaultMetadata| replace:: :class:`~plums.model.validation.metadata.DefaultMetadata` +.. |ProducerVersionSchema| replace:: :class:`~plums.model.validation.metadata.ProducerVersion` +.. |ProducerSchema| replace:: :class:`~plums.model.validation.metadata.Producer` +.. |FormatSchema| replace:: :class:`~plums.model.validation.metadata.Format` +.. |CheckpointSchema| replace:: :class:`~plums.model.validation.metadata.Checkpoint` +.. |TrainingSchema| replace:: :class:`~plums.model.validation.metadata.Training` +.. |ConfigurationSchema| replace:: :class:`~plums.model.validation.metadata.Configuration` +.. |InitialisationPathSchema| replace:: :class:`~plums.model.validation.metadata.InitialisationPath` +.. |InitialisationPMFSchema| replace:: :class:`~plums.model.validation.metadata.InitialisationPMF` +.. |InitialisationSchema| replace:: :class:`~plums.model.validation.metadata.Initialisation` +.. |ModelSchema| replace:: :class:`~plums.model.validation.metadata.Model` +.. |MetadataSchema| replace:: :class:`~plums.model.validation.metadata.Metadata` + +.. |TreeComponent| replace:: :class:`~plums.model.validation.structure.TreeComponent` +.. |DefaultTree| replace:: :class:`~plums.model.validation.structure.DefaultTree` +.. |MetadataTree| replace:: :class:`~plums.model.validation.structure.Metadata` + +.. |DataTree| replace:: :class:`~plums.model.validation.structure.Data` +.. |CheckpointTree| replace:: :class:`~plums.model.validation.structure.Checkpoint` +.. |InitialisationTree| replace:: :class:`~plums.model.validation.structure.Initialisation` +.. |InitialisationPMFTree| replace:: :class:`~plums.model.validation.structure.InitialisationPMF` +.. |InitialisationPathTree| replace:: :class:`~plums.model.validation.structure.InitialisationPath` +.. |ModelTree| replace:: :class:`~plums.model.validation.structure.Model` +.. |PathTree| replace:: :class:`~plums.model.validation.structure.Path` + +.. |Model| replace:: :class:`~plums.model.model.Model` + +.. |initialisation| replace:: :class:`~plums.model.model.initialisation` +.. |Training| replace:: :class:`~plums.model.components.components.Training` +.. |Producer| replace:: :class:`~plums.model.components.components.Producer` +.. |CheckpointCollection| replace:: :class:`~plums.model.components.components.CheckpointCollection` +.. |TrainingStatus| replace:: :class:`~plums.model.components.utils.TrainingStatus` +.. |Checkpoint| replace:: :class:`~plums.model.components.utils.Checkpoint` +.. |ProducerVersion| replace:: :class:`~plums.model.components.version.Version` +.. |PyPaVersion| replace:: :class:`~plums.model.components.version.PyPA` + +.. |version| replace:: :class:`~plums.model.components.version.version` +.. |register| replace:: :class:`~plums.model.components.version.register` +.. |is_duplicate| replace:: :class:`~plums.model.components.utils.is_duplicate` +.. |copy| replace:: :class:`~plums.model.components.utils.copy` +.. |rmtree| replace:: :class:`~plums.model.components.utils.rmtree` .. Classes substitutions for plot: ============================== -.. |Draw| replace:: :class:`~playground_plums.plot.engine.painter.Draw` -.. |TagPainter| replace:: :class:`~playground_plums.plot.engine.painter.TagPainter` -.. |Geometry| replace:: :class:`~playground_plums.plot.engine.painter.Geometry` -.. |Painter| replace:: :class:`~playground_plums.plot.engine.Painter` -.. |PainterBase| replace:: :class:`~playground_plums.plot.engine.painter.PainterBase` -.. |Position| replace:: :class:`~playground_plums.plot.engine.painter.Position` - -.. |LegendPainter| replace:: :class:`~playground_plums.plot.engine.legend_painter.LegendPainter` - -.. |Compositor| replace:: :class:`~playground_plums.plot.engine.Compositor` - -.. |SimpleImagePositionGenerator| replace:: :class:`~playground_plums.plot.engine.position_generator.SimpleImagePositionGenerator` -.. |LayoutImagePositionGenerator| replace:: :class:`~playground_plums.plot.engine.position_generator.LayoutImagePositionGenerator` -.. |AdaptiveImagePositionGenerator| replace:: :class:`~playground_plums.plot.engine.position_generator.AdaptiveImagePositionGenerator` - -.. |Color| replace:: :class:`~playground_plums.plot.engine.Color` -.. |ColorMap| replace:: :class:`~playground_plums.plot.engine.ColorMap` -.. |ContinuousColorMap| replace:: :class:`~playground_plums.plot.engine.ContinuousColorMap` -.. |DiscreteColorMap| replace:: :class:`~playground_plums.plot.engine.DiscreteColorMap` -.. |CategoricalColorMap| replace:: :class:`~playground_plums.plot.engine.CategoricalColorMap` -.. |KeyPointsColorMap| replace:: :class:`~playground_plums.plot.engine.KeyPointsColorMap` -.. |CircularColorMap| replace:: :class:`~playground_plums.plot.engine.CircularColorMap` -.. |SemiCircularColorMap| replace:: :class:`~playground_plums.plot.engine.SemiCircularColorMap` -.. |LightnessColorMap| replace:: :class:`~playground_plums.plot.engine.LightnessColorMap` - -.. |Labels| replace:: :class:`~playground_plums.plot.Labels` -.. |Confidence| replace:: :class:`~playground_plums.plot.Confidence` -.. |Area| replace:: :class:`~playground_plums.plot.Area` -.. |Descriptor| replace:: :class:`~playground_plums.plot.engine.Descriptor` -.. |CategoricalDescriptor| replace:: :class:`~playground_plums.plot.CategoricalDescriptor` -.. |ContinuousDescriptor| replace:: :class:`~playground_plums.plot.ContinuousDescriptor` -.. |IntervalDescriptor| replace:: :class:`~playground_plums.plot.IntervalDescriptor` -.. |ColorEngine| replace:: :class:`~playground_plums.plot.engine.color_engine.ColorEngine` -.. |ByCategoryDescriptor| replace:: :class:`~playground_plums.plot.engine.color_engine.ByCategoryDescriptor` -.. |CategoricalRecordCollection| replace:: :class:`~playground_plums.plot.engine.color_engine.CategoricalRecordCollection` - -.. |Orchestrator| replace:: :class:`~playground_plums.plot.engine.Orchestrator` - -.. |Plot| replace:: :class:`~playground_plums.plot.Plot` -.. |PairPlot| replace:: :class:`~playground_plums.plot.PairPlot` -.. |StandardPlot| replace:: :class:`~playground_plums.plot.StandardPlot` +.. |Draw| replace:: :class:`~plums.plot.engine.painter.Draw` +.. |TagPainter| replace:: :class:`~plums.plot.engine.painter.TagPainter` +.. |Geometry| replace:: :class:`~plums.plot.engine.painter.Geometry` +.. |Painter| replace:: :class:`~plums.plot.engine.Painter` +.. |PainterBase| replace:: :class:`~plums.plot.engine.painter.PainterBase` +.. |Position| replace:: :class:`~plums.plot.engine.painter.Position` + +.. |LegendPainter| replace:: :class:`~plums.plot.engine.legend_painter.LegendPainter` + +.. |Compositor| replace:: :class:`~plums.plot.engine.Compositor` + +.. |SimpleImagePositionGenerator| replace:: :class:`~plums.plot.engine.position_generator.SimpleImagePositionGenerator` +.. |LayoutImagePositionGenerator| replace:: :class:`~plums.plot.engine.position_generator.LayoutImagePositionGenerator` +.. |AdaptiveImagePositionGenerator| replace:: :class:`~plums.plot.engine.position_generator.AdaptiveImagePositionGenerator` + +.. |Color| replace:: :class:`~plums.plot.engine.Color` +.. |ColorMap| replace:: :class:`~plums.plot.engine.ColorMap` +.. |ContinuousColorMap| replace:: :class:`~plums.plot.engine.ContinuousColorMap` +.. |DiscreteColorMap| replace:: :class:`~plums.plot.engine.DiscreteColorMap` +.. |CategoricalColorMap| replace:: :class:`~plums.plot.engine.CategoricalColorMap` +.. |KeyPointsColorMap| replace:: :class:`~plums.plot.engine.KeyPointsColorMap` +.. |CircularColorMap| replace:: :class:`~plums.plot.engine.CircularColorMap` +.. |SemiCircularColorMap| replace:: :class:`~plums.plot.engine.SemiCircularColorMap` +.. |LightnessColorMap| replace:: :class:`~plums.plot.engine.LightnessColorMap` + +.. |Labels| replace:: :class:`~plums.plot.Labels` +.. |Confidence| replace:: :class:`~plums.plot.Confidence` +.. |Area| replace:: :class:`~plums.plot.Area` +.. |Descriptor| replace:: :class:`~plums.plot.engine.Descriptor` +.. |CategoricalDescriptor| replace:: :class:`~plums.plot.CategoricalDescriptor` +.. |ContinuousDescriptor| replace:: :class:`~plums.plot.ContinuousDescriptor` +.. |IntervalDescriptor| replace:: :class:`~plums.plot.IntervalDescriptor` +.. |ColorEngine| replace:: :class:`~plums.plot.engine.color_engine.ColorEngine` +.. |ByCategoryDescriptor| replace:: :class:`~plums.plot.engine.color_engine.ByCategoryDescriptor` +.. |CategoricalRecordCollection| replace:: :class:`~plums.plot.engine.color_engine.CategoricalRecordCollection` + +.. |Orchestrator| replace:: :class:`~plums.plot.engine.Orchestrator` + +.. |Plot| replace:: :class:`~plums.plot.Plot` +.. |PairPlot| replace:: :class:`~plums.plot.PairPlot` +.. |StandardPlot| replace:: :class:`~plums.plot.StandardPlot` diff --git a/noxfile.py b/noxfile.py index 5a4da2a..d981cce 100644 --- a/noxfile.py +++ b/noxfile.py @@ -4,12 +4,12 @@ @nox.session(reuse_venv=True) def lint(session): session.install('.[lint]') - session.run('flake8', '-v', 'playground_plums') + session.run('flake8', '-v', 'plums') session.run('flake8', '-v', '--ignore=D', 'tests') @nox.session(python=['3.6', '3.7', '3.8', '3.9'], reuse_venv=True) def tests(session): session.install('.[tests]') - session.run('pytest', '-vv', '--cov-report', 'term-missing', '--cov=playground_plums', '--ignore=tests/test_dataflow', 'tests/') - session.run('pytest', '-vv', '--cov-report', 'term-missing', '--cov=playground_plums', 'tests/test_dataflow') + session.run('pytest', '-vv', '--cov-report', 'term-missing', '--cov=plums', '--ignore=tests/test_dataflow', 'tests/') + session.run('pytest', '-vv', '--cov-report', 'term-missing', '--cov=plums', 'tests/test_dataflow') diff --git a/playground_plums/__init__.py b/playground_plums/__init__.py deleted file mode 100755 index 2b8877c..0000000 --- a/playground_plums/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = '0.5.0' diff --git a/playground_plums/model/__init__.py b/playground_plums/model/__init__.py deleted file mode 100755 index 5c05cb9..0000000 --- a/playground_plums/model/__init__.py +++ /dev/null @@ -1,6 +0,0 @@ -__version__ = '0.2.1' - - -from playground_plums.model.exception import PlumsError, PlumsValidationError, PlumsModelError, \ - PlumsModelMetadataValidationError, PlumsModelTreeValidationError -from playground_plums.model.model import Model, Producer, Training, CheckpointCollection, Checkpoint diff --git a/playground_plums/model/components/__init__.py b/playground_plums/model/components/__init__.py deleted file mode 100755 index 7676833..0000000 --- a/playground_plums/model/components/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from playground_plums.model.components.components import Producer, Training, CheckpointCollection, Checkpoint diff --git a/plums/__init__.py b/plums/__init__.py new file mode 100755 index 0000000..93b60a1 --- /dev/null +++ b/plums/__init__.py @@ -0,0 +1 @@ +__version__ = '0.5.1' diff --git a/playground_plums/commons/__init__.py b/plums/commons/__init__.py similarity index 100% rename from playground_plums/commons/__init__.py rename to plums/commons/__init__.py diff --git a/playground_plums/commons/data/__init__.py b/plums/commons/data/__init__.py similarity index 100% rename from playground_plums/commons/data/__init__.py rename to plums/commons/data/__init__.py diff --git a/playground_plums/commons/data/base.py b/plums/commons/data/base.py similarity index 100% rename from playground_plums/commons/data/base.py rename to plums/commons/data/base.py diff --git a/playground_plums/commons/data/data.py b/plums/commons/data/data.py similarity index 100% rename from playground_plums/commons/data/data.py rename to plums/commons/data/data.py diff --git a/playground_plums/commons/data/mask.py b/plums/commons/data/mask.py similarity index 100% rename from playground_plums/commons/data/mask.py rename to plums/commons/data/mask.py diff --git a/playground_plums/commons/data/mixin.py b/plums/commons/data/mixin.py similarity index 100% rename from playground_plums/commons/data/mixin.py rename to plums/commons/data/mixin.py diff --git a/playground_plums/commons/data/record.py b/plums/commons/data/record.py similarity index 98% rename from playground_plums/commons/data/record.py rename to plums/commons/data/record.py index 61cf1cc..714d371 100755 --- a/playground_plums/commons/data/record.py +++ b/plums/commons/data/record.py @@ -111,10 +111,10 @@ def __len__(self): return len(self.records) def get(self, max_depth=None): - """Get |Record| and cap their :attr:`~playground_plums.commons.data.record.Record.labels` to a maximum depth. + """Get |Record| and cap their :attr:`~plums.commons.data.record.Record.labels` to a maximum depth. See Also: - The label :meth:`~playground_plums.commons.data.record.Record.get_labels` method which handles the lifting. + The label :meth:`~plums.commons.data.record.Record.get_labels` method which handles the lifting. Args: max_depth (int, dict): Optional. Default to ``None``. diff --git a/playground_plums/commons/data/taxonomy/__init__.py b/plums/commons/data/taxonomy/__init__.py similarity index 96% rename from playground_plums/commons/data/taxonomy/__init__.py rename to plums/commons/data/taxonomy/__init__.py index ba0d6ba..4641205 100755 --- a/playground_plums/commons/data/taxonomy/__init__.py +++ b/plums/commons/data/taxonomy/__init__.py @@ -81,9 +81,9 @@ class Taxonomy(Tree): **unrelated** concepts, it should be acceptable to have a *raw* being a sort of *eggs* and another type of *raw* being a sort of *meat*; however, this is prohibited in *Plums*. - Those relationships allow for set-aware |Label| lookups (as in :meth:`~playground_plums.commons.Tree.get` or - :meth:`~playground_plums.commons.Tree.__getitem__`), tree iteration (as in - :meth:`~playground_plums.commons.Tree.iterate`) and |Label| tuple validation against self's taxonomy. + Those relationships allow for set-aware |Label| lookups (as in :meth:`~plums.commons.Tree.get` or + :meth:`~plums.commons.Tree.__getitem__`), tree iteration (as in + :meth:`~plums.commons.Tree.iterate`) and |Label| tuple validation against self's taxonomy. Creation of |Taxonomy| is made with the |Label| class which acts as |Tree| nodes. For example, to recreate the example from above, one could do: @@ -108,7 +108,7 @@ class Taxonomy(Tree): For more information on |Tree| creation, see the |Label| class API documentation. Once the |Taxonomy| is created, apart from the usual |Tree| interfaces, the |Taxonomy| instance exposes every - *true-roots* |Tree| as attributes and :attr:`~playground_plums.commons.PropertyContainer.properties`: + *true-roots* |Tree| as attributes and :attr:`~plums.commons.PropertyContainer.properties`: .. code-block:: python diff --git a/playground_plums/commons/data/taxonomy/accessor.py b/plums/commons/data/taxonomy/accessor.py similarity index 100% rename from playground_plums/commons/data/taxonomy/accessor.py rename to plums/commons/data/taxonomy/accessor.py diff --git a/playground_plums/commons/data/taxonomy/iterator.py b/plums/commons/data/taxonomy/iterator.py similarity index 88% rename from playground_plums/commons/data/taxonomy/iterator.py rename to plums/commons/data/taxonomy/iterator.py index 5123063..f48bb40 100755 --- a/playground_plums/commons/data/taxonomy/iterator.py +++ b/plums/commons/data/taxonomy/iterator.py @@ -23,7 +23,7 @@ def __repr__(self): def __iter__(self): """Make an iterator which iterate through a |Tree| in a select order. - Yields (:class:`~playground_plums.commons.Label`, Iterable[:class:`~playground_plums.commons.Label`]): + Yields (:class:`~plums.commons.Label`, Iterable[:class:`~plums.commons.Label`]): Either a tree node or an ensemble of nodes. """ @@ -64,7 +64,7 @@ def __init__(self, tree, max_depth=None): def __iter__(self): """Make an iterator which iterate through a |Tree| in a top-down order. - Yields (:class:`~playground_plums.commons.Label`): A tree |Label| node. + Yields (:class:`~plums.commons.Label`): A tree |Label| node. """ self._iterator = iter(TopDownTreeIterator(self._tree, max_depth=self._max_depth)) @@ -73,7 +73,7 @@ def __iter__(self): def __next__(self): """Iterate through a |Tree| in a top-down order. - Yields (:class:`~playground_plums.commons.Label`): A tree |Label| node. + Yields (:class:`~plums.commons.Label`): A tree |Label| node. """ return next(self._iterator) @@ -84,7 +84,7 @@ def top_down(self): See Also: The |TopDownTreeIterator| class. - Yields (:class:`~playground_plums.commons.Label`): A tree |Label| node. + Yields (:class:`~plums.commons.Label`): A tree |Label| node. """ return iter(self) @@ -95,7 +95,7 @@ def bottom_up(self): See Also: The |BottomUpTreeIterator| class. - Yields (:class:`~playground_plums.commons.Label`): A tree |Label| node. + Yields (:class:`~plums.commons.Label`): A tree |Label| node. """ return iter(BottomUpTreeIterator(self._tree, self._max_depth)) @@ -106,7 +106,7 @@ def depth_wise_top_down(self): See Also: The |TopDownDepthWiseTreeIterator| class. - Yields (Iterable[:class:`~playground_plums.commons.Label`]): An iterator over an ensemble of |Label| nodes. + Yields (Iterable[:class:`~plums.commons.Label`]): An iterator over an ensemble of |Label| nodes. """ return iter(TopDownDepthWiseTreeIterator(self._tree, self._max_depth)) @@ -117,7 +117,7 @@ def depth_wise_bottom_up(self): See Also: The |BottomUpDepthWiseTreeIterator| class. - Yields (Iterable[:class:`~playground_plums.commons.Label`]): An iterator over an ensemble of |Label| nodes. + Yields (Iterable[:class:`~plums.commons.Label`]): An iterator over an ensemble of |Label| nodes. """ return iter(BottomUpDepthWiseTreeIterator(self._tree, self._max_depth)) @@ -131,7 +131,7 @@ def floor(self, depth): See Also: The |FloorTreeIterator| class. - Yields (:class:`~playground_plums.commons.Label`): A tree |Label| node. + Yields (:class:`~plums.commons.Label`): A tree |Label| node. """ return iter(FloorTreeIterator(self._tree, depth)) @@ -167,7 +167,7 @@ class TopDownTreeIterator(TreeIteratorBase): def __iter__(self): """Make an iterator which iterate through a |Tree| in a top-down order. - Yields (:class:`~playground_plums.commons.Label`): A tree |Label| node. + Yields (:class:`~plums.commons.Label`): A tree |Label| node. """ def top_down(label): @@ -211,7 +211,7 @@ class BottomUpTreeIterator(TreeIteratorBase): def __iter__(self): """Make an iterator which iterate through a |Tree| in a bottom-up order. - Yields (:class:`~playground_plums.commons.Label`): A tree |Label| node. + Yields (:class:`~plums.commons.Label`): A tree |Label| node. """ return \ @@ -252,7 +252,7 @@ def __init__(self, tree, depth): def __iter__(self): """Make an iterator which iterate through a |Tree| given depth floor. - Yields (:class:`~playground_plums.commons.Label`): A tree |Label| node. + Yields (:class:`~plums.commons.Label`): A tree |Label| node. """ return iter(self._tree.depth_wise[self._depth]) @@ -285,7 +285,7 @@ class TopDownDepthWiseTreeIterator(TreeIteratorBase): def __iter__(self): """Make an iterator which iterate through a |Tree| in a depth-wise top-down order. - Yields (Iterable[:class:`~playground_plums.commons.Label`]): An iterator over an ensemble of |Label| nodes. + Yields (Iterable[:class:`~plums.commons.Label`]): An iterator over an ensemble of |Label| nodes. """ def depth_wise(): @@ -322,7 +322,7 @@ class BottomUpDepthWiseTreeIterator(TreeIteratorBase): def __iter__(self): """Make an iterator which iterate through a |Tree| in a depth-wise bottom-up order. - Yields (Iterable[:class:`~playground_plums.commons.Label`]): An iterator over an ensemble of |Label| nodes. + Yields (Iterable[:class:`~plums.commons.Label`]): An iterator over an ensemble of |Label| nodes. """ return \ diff --git a/playground_plums/commons/data/taxonomy/label.py b/plums/commons/data/taxonomy/label.py similarity index 100% rename from playground_plums/commons/data/taxonomy/label.py rename to plums/commons/data/taxonomy/label.py diff --git a/playground_plums/commons/data/taxonomy/tree.py b/plums/commons/data/taxonomy/tree.py similarity index 99% rename from playground_plums/commons/data/taxonomy/tree.py rename to plums/commons/data/taxonomy/tree.py index 5430c08..ef7bcd0 100755 --- a/playground_plums/commons/data/taxonomy/tree.py +++ b/plums/commons/data/taxonomy/tree.py @@ -309,7 +309,7 @@ def represent(self, max_depth=None): return '\n'.join(iterator) def ancestors(self, label): - """All of labels's ancestors going upward from label :attr:`~playground_plums.commons.data.taxonomy.label.Label.parent`. + """All of labels's ancestors going upward from label :attr:`~plums.commons.data.taxonomy.label.Label.parent`. Args: label (|Label|): A |Label| somewhere in self's tree. diff --git a/playground_plums/commons/data/tile.py b/plums/commons/data/tile.py similarity index 100% rename from playground_plums/commons/data/tile.py rename to plums/commons/data/tile.py diff --git a/playground_plums/commons/path.py b/plums/commons/path.py similarity index 98% rename from playground_plums/commons/path.py rename to plums/commons/path.py index 14f28b8..651bd9d 100755 --- a/playground_plums/commons/path.py +++ b/plums/commons/path.py @@ -168,7 +168,7 @@ def ext(self): @property def _stat(self): - """:class:`~playground_plums.commons.path._Stat`: ``self`` corresponding object.""" + """:class:`~plums.commons.path._Stat`: ``self`` corresponding object.""" if hash(self) != hash(self.__stat): self.__stat = _Stat(self) return self.__stat @@ -402,7 +402,7 @@ def listdir(self): """List elements found in |Path|. Yields: - :class:`~playground_plums.commons.Path`: Each element found in |Path|. + :class:`~plums.commons.Path`: Each element found in |Path|. """ for path in os.listdir(str(self)): @@ -424,8 +424,8 @@ def walk(self, topdown=True, onerror=None, followlinks=False): followlinks (bool): Whether to follow symbolic links whilst recursing through the directories. Yields: - (:class:`~playground_plums.commons.Path` , [:class:`~playground_plums.commons.Path`], - [:class:`~playground_plums.commons.Path`]): + (:class:`~plums.commons.Path` , [:class:`~plums.commons.Path`], + [:class:`~plums.commons.Path`]): A triple containing the current root directory, a list of found directories inside and a list of found files inside. @@ -453,7 +453,7 @@ def glob(self, pattern): pattern (PathLike): A globing pattern to match against all elements in |Path|. Yields: - :class:`~playground_plums.commons.Path`: Matching files. + :class:`~plums.commons.Path`: Matching files. Note: The ``**`` pattern means "this directory and all subdirectories, recursively". In other words, it enables @@ -490,7 +490,7 @@ def rglob(self, pattern): pattern (PathLike): A globing pattern to recursively match against all elements in |Path|. Yields: - :class:`~playground_plums.commons.Path`: Matching files. + :class:`~plums.commons.Path`: Matching files. Note: The ``**`` pattern means "this directory and all subdirectories, recursively". In other words, it enables diff --git a/playground_plums/dataflow/__init__.py b/plums/dataflow/__init__.py similarity index 100% rename from playground_plums/dataflow/__init__.py rename to plums/dataflow/__init__.py diff --git a/playground_plums/dataflow/dataset/__init__.py b/plums/dataflow/dataset/__init__.py similarity index 100% rename from playground_plums/dataflow/dataset/__init__.py rename to plums/dataflow/dataset/__init__.py diff --git a/playground_plums/dataflow/dataset/base.py b/plums/dataflow/dataset/base.py similarity index 100% rename from playground_plums/dataflow/dataset/base.py rename to plums/dataflow/dataset/base.py diff --git a/playground_plums/dataflow/dataset/pattern.py b/plums/dataflow/dataset/pattern.py similarity index 99% rename from playground_plums/dataflow/dataset/pattern.py rename to plums/dataflow/dataset/pattern.py index 90fb4dc..2555763 100755 --- a/playground_plums/dataflow/dataset/pattern.py +++ b/plums/dataflow/dataset/pattern.py @@ -3,8 +3,8 @@ from ordered_set import OrderedSet -from playground_plums.commons.path import Path -from playground_plums.commons.data import DataPoint +from plums.commons.path import Path +from plums.commons.data import DataPoint from .base import SizedDataset from ..utils.cache import DatasetCache, NotInCacheError from ..utils.path import PathResolver diff --git a/playground_plums/dataflow/dataset/playground.py b/plums/dataflow/dataset/playground.py similarity index 99% rename from playground_plums/dataflow/dataset/playground.py rename to plums/dataflow/dataset/playground.py index 6af682e..b6fc9a1 100755 --- a/playground_plums/dataflow/dataset/playground.py +++ b/plums/dataflow/dataset/playground.py @@ -2,8 +2,8 @@ import numpy as np -from playground_plums.commons.path import Path -from playground_plums.commons.data import ( +from plums.commons.path import Path +from plums.commons.data import ( TileCollection, Annotation, MaskCollection, diff --git a/playground_plums/dataflow/io/__init__.py b/plums/dataflow/io/__init__.py similarity index 100% rename from playground_plums/dataflow/io/__init__.py rename to plums/dataflow/io/__init__.py diff --git a/playground_plums/dataflow/io/json.py b/plums/dataflow/io/json.py similarity index 100% rename from playground_plums/dataflow/io/json.py rename to plums/dataflow/io/json.py diff --git a/playground_plums/dataflow/io/tile/__init__.py b/plums/dataflow/io/tile/__init__.py similarity index 100% rename from playground_plums/dataflow/io/tile/__init__.py rename to plums/dataflow/io/tile/__init__.py diff --git a/playground_plums/dataflow/io/tile/_backend.py b/plums/dataflow/io/tile/_backend.py similarity index 97% rename from playground_plums/dataflow/io/tile/_backend.py rename to plums/dataflow/io/tile/_backend.py index a1b1e32..44763ba 100755 --- a/playground_plums/dataflow/io/tile/_backend.py +++ b/plums/dataflow/io/tile/_backend.py @@ -2,7 +2,7 @@ import numpy as np -from playground_plums.commons.path import Path +from plums.commons.path import Path # Image backends import try: @@ -33,7 +33,7 @@ # Backend import sanity check if not _HAS_TURBO_JPEG and not _HAS_LYCON and not _HAS_CV2 and not _HAS_PILLOW: - raise ImportError('Error importing playground_plums.dataflow.io: No suitable image backend where found. ' + raise ImportError('Error importing plums.dataflow.io: No suitable image backend where found. ' 'For more information, please refer to the documentation.') diff --git a/playground_plums/dataflow/io/tile/_format/__init__.py b/plums/dataflow/io/tile/_format/__init__.py similarity index 100% rename from playground_plums/dataflow/io/tile/_format/__init__.py rename to plums/dataflow/io/tile/_format/__init__.py diff --git a/playground_plums/dataflow/io/tile/_format/channels.py b/plums/dataflow/io/tile/_format/channels.py similarity index 100% rename from playground_plums/dataflow/io/tile/_format/channels.py rename to plums/dataflow/io/tile/_format/channels.py diff --git a/playground_plums/dataflow/io/tile/_format/ptype.py b/plums/dataflow/io/tile/_format/ptype.py similarity index 100% rename from playground_plums/dataflow/io/tile/_format/ptype.py rename to plums/dataflow/io/tile/_format/ptype.py diff --git a/playground_plums/dataflow/io/tile/_format/utils.py b/plums/dataflow/io/tile/_format/utils.py similarity index 100% rename from playground_plums/dataflow/io/tile/_format/utils.py rename to plums/dataflow/io/tile/_format/utils.py diff --git a/playground_plums/dataflow/io/tile/_vendor/__init__.py b/plums/dataflow/io/tile/_vendor/__init__.py similarity index 100% rename from playground_plums/dataflow/io/tile/_vendor/__init__.py rename to plums/dataflow/io/tile/_vendor/__init__.py diff --git a/playground_plums/dataflow/io/tile/_vendor/turbojpeg.py b/plums/dataflow/io/tile/_vendor/turbojpeg.py similarity index 100% rename from playground_plums/dataflow/io/tile/_vendor/turbojpeg.py rename to plums/dataflow/io/tile/_vendor/turbojpeg.py diff --git a/playground_plums/dataflow/io/tile/tile.py b/plums/dataflow/io/tile/tile.py similarity index 98% rename from playground_plums/dataflow/io/tile/tile.py rename to plums/dataflow/io/tile/tile.py index b66bd4f..a7607cc 100755 --- a/playground_plums/dataflow/io/tile/tile.py +++ b/plums/dataflow/io/tile/tile.py @@ -1,7 +1,7 @@ import numpy as np -from playground_plums.commons.data import Tile as CommonsTile -from playground_plums.commons.data import PropertyContainer +from plums.commons.data import Tile as CommonsTile +from plums.commons.data import PropertyContainer from ._format import rgb, RGB, rgba, RGBA, bgr, BGR, bgra, BGRA, grey, GREY, y, Y, ptype from ._backend import Image diff --git a/playground_plums/dataflow/utils/__init__.py b/plums/dataflow/utils/__init__.py similarity index 100% rename from playground_plums/dataflow/utils/__init__.py rename to plums/dataflow/utils/__init__.py diff --git a/playground_plums/dataflow/utils/cache.py b/plums/dataflow/utils/cache.py similarity index 98% rename from playground_plums/dataflow/utils/cache.py rename to plums/dataflow/utils/cache.py index 192f99f..11c9762 100755 --- a/playground_plums/dataflow/utils/cache.py +++ b/plums/dataflow/utils/cache.py @@ -2,7 +2,7 @@ from appdirs import user_cache_dir -from playground_plums.commons.path import Path +from plums.commons.path import Path from .path import PathResolver from ..io.json import load, dump diff --git a/playground_plums/dataflow/utils/parser/__init__.py b/plums/dataflow/utils/parser/__init__.py similarity index 100% rename from playground_plums/dataflow/utils/parser/__init__.py rename to plums/dataflow/utils/parser/__init__.py diff --git a/playground_plums/dataflow/utils/parser/exceptions.py b/plums/dataflow/utils/parser/exceptions.py similarity index 100% rename from playground_plums/dataflow/utils/parser/exceptions.py rename to plums/dataflow/utils/parser/exceptions.py diff --git a/playground_plums/dataflow/utils/parser/grammar.lark b/plums/dataflow/utils/parser/grammar.lark similarity index 100% rename from playground_plums/dataflow/utils/parser/grammar.lark rename to plums/dataflow/utils/parser/grammar.lark diff --git a/playground_plums/dataflow/utils/parser/parser.py b/plums/dataflow/utils/parser/parser.py similarity index 98% rename from playground_plums/dataflow/utils/parser/parser.py rename to plums/dataflow/utils/parser/parser.py index d2bb6dc..aa303a4 100755 --- a/playground_plums/dataflow/utils/parser/parser.py +++ b/plums/dataflow/utils/parser/parser.py @@ -1,6 +1,6 @@ from lark import Lark, Transformer -from playground_plums.commons.path import Path +from plums.commons.path import Path from .resolver import ComponentResolver, GroupResolver, ExtensionResolver diff --git a/playground_plums/dataflow/utils/parser/resolver.py b/plums/dataflow/utils/parser/resolver.py similarity index 100% rename from playground_plums/dataflow/utils/parser/resolver.py rename to plums/dataflow/utils/parser/resolver.py diff --git a/playground_plums/dataflow/utils/parser/validator.py b/plums/dataflow/utils/parser/validator.py similarity index 100% rename from playground_plums/dataflow/utils/parser/validator.py rename to plums/dataflow/utils/parser/validator.py diff --git a/playground_plums/dataflow/utils/path.py b/plums/dataflow/utils/path.py similarity index 99% rename from playground_plums/dataflow/utils/path.py rename to plums/dataflow/utils/path.py index 407cbd0..467b691 100755 --- a/playground_plums/dataflow/utils/path.py +++ b/plums/dataflow/utils/path.py @@ -1,7 +1,7 @@ import re from copy import copy -from playground_plums.commons.path import Path +from plums.commons.path import Path from .parser import Parser, ComponentResolver, GroupResolver diff --git a/plums/model/__init__.py b/plums/model/__init__.py new file mode 100755 index 0000000..0e3d0e3 --- /dev/null +++ b/plums/model/__init__.py @@ -0,0 +1,6 @@ +__version__ = '0.2.1' + + +from plums.model.exception import PlumsError, PlumsValidationError, PlumsModelError, \ + PlumsModelMetadataValidationError, PlumsModelTreeValidationError +from plums.model.model import Model, Producer, Training, CheckpointCollection, Checkpoint diff --git a/plums/model/components/__init__.py b/plums/model/components/__init__.py new file mode 100755 index 0000000..3287c6d --- /dev/null +++ b/plums/model/components/__init__.py @@ -0,0 +1 @@ +from plums.model.components.components import Producer, Training, CheckpointCollection, Checkpoint diff --git a/playground_plums/model/components/components.py b/plums/model/components/components.py similarity index 96% rename from playground_plums/model/components/components.py rename to plums/model/components/components.py index 73f1cdc..070f33a 100755 --- a/playground_plums/model/components/components.py +++ b/plums/model/components/components.py @@ -2,11 +2,11 @@ from collections import OrderedDict from functools import total_ordering -from playground_plums.commons.path import Path -from playground_plums.model.exception import PlumsModelMetadataValidationError -from playground_plums.model.validation.metadata import Training as TrainingMetadata -from playground_plums.model.components.version import version -from playground_plums.model.components.utils import TrainingStatus, Checkpoint, is_duplicate +from plums.commons.path import Path +from plums.model.exception import PlumsModelMetadataValidationError +from plums.model.validation.metadata import Training as TrainingMetadata +from plums.model.components.version import version +from plums.model.components.utils import TrainingStatus, Checkpoint, is_duplicate class Training(object): @@ -383,7 +383,7 @@ def values(self): """Iterate through the collection's |Checkpoint| as in a dict, in insertion order. Yields: - :class:`~playground_plums.model.components.utils.Checkpoint`: A |Checkpoint|. + :class:`~plums.model.components.utils.Checkpoint`: A |Checkpoint|. """ return self._checkpoints.values() @@ -392,7 +392,7 @@ def items(self): """Iterate through the collection as in a dict, in insertion order. Yields: - (hashable, :class:`~playground_plums.model.components.utils.Checkpoint`): Reference and |Checkpoint|. + (hashable, :class:`~plums.model.components.utils.Checkpoint`): Reference and |Checkpoint|. """ return self._checkpoints.items() diff --git a/playground_plums/model/components/utils.py b/plums/model/components/utils.py similarity index 98% rename from playground_plums/model/components/utils.py rename to plums/model/components/utils.py index 5dff6b1..3fb3dc9 100755 --- a/playground_plums/model/components/utils.py +++ b/plums/model/components/utils.py @@ -4,9 +4,9 @@ import yaml -from playground_plums.commons.path import Path -from playground_plums.model.validation.schema_core import MD5Checksum -from playground_plums.model.validation.utils.checksum import md5_checksum +from plums.commons.path import Path +from plums.model.validation.schema_core import MD5Checksum +from plums.model.validation.utils.checksum import md5_checksum def is_duplicate(file_1, file_2, hash_1=None, hash_2=None, checksum=md5_checksum): diff --git a/playground_plums/model/components/version.py b/plums/model/components/version.py similarity index 100% rename from playground_plums/model/components/version.py rename to plums/model/components/version.py diff --git a/playground_plums/model/exception.py b/plums/model/exception.py similarity index 100% rename from playground_plums/model/exception.py rename to plums/model/exception.py diff --git a/playground_plums/model/model.py b/plums/model/model.py similarity index 98% rename from playground_plums/model/model.py rename to plums/model/model.py index 94c319e..dc24dac 100755 --- a/playground_plums/model/model.py +++ b/plums/model/model.py @@ -1,13 +1,13 @@ import yaml from schema import SchemaError -from playground_plums.commons.path import Path -from playground_plums.model.exception import PlumsValidationError -from playground_plums.model.components.utils import copy, rmtree, Mock -from playground_plums.model.validation import Metadata -from playground_plums.model.validation import validate -from playground_plums.model.components import Producer, Training, CheckpointCollection, Checkpoint -from playground_plums.model.validation.utils.checksum import md5_checksum +from plums.commons.path import Path +from plums.model.exception import PlumsValidationError +from plums.model.components.utils import copy, rmtree, Mock +from plums.model.validation import Metadata +from plums.model.validation import validate +from plums.model.components import Producer, Training, CheckpointCollection, Checkpoint +from plums.model.validation.utils.checksum import md5_checksum class Model(object): diff --git a/playground_plums/model/validation/__init__.py b/plums/model/validation/__init__.py similarity index 74% rename from playground_plums/model/validation/__init__.py rename to plums/model/validation/__init__.py index bd74392..cf08821 100755 --- a/playground_plums/model/validation/__init__.py +++ b/plums/model/validation/__init__.py @@ -1,7 +1,7 @@ -from playground_plums.commons.path import Path -from playground_plums.model.validation.structure import Model -from playground_plums.model.validation.metadata import Metadata -from playground_plums.model.validation.utils.dict_from_tree import make_dict_structure_from_tree +from plums.commons.path import Path +from plums.model.validation.structure import Model +from plums.model.validation.metadata import Metadata +from plums.model.validation.utils.dict_from_tree import make_dict_structure_from_tree def validate(path, strict=False, verbose=False, **kwargs): diff --git a/playground_plums/model/validation/metadata.py b/plums/model/validation/metadata.py similarity index 91% rename from playground_plums/model/validation/metadata.py rename to plums/model/validation/metadata.py index 2b5b6fa..b15b779 100755 --- a/playground_plums/model/validation/metadata.py +++ b/plums/model/validation/metadata.py @@ -1,7 +1,7 @@ import schema -from playground_plums.model.exception import PlumsValidationError, PlumsModelMetadataValidationError -from playground_plums.model.validation.schema_core import SchemaComponent, Path, MD5Checksum, Default +from plums.model.exception import PlumsValidationError, PlumsModelMetadataValidationError +from plums.model.validation.schema_core import SchemaComponent, Path, MD5Checksum, Default class MetadataComponent(SchemaComponent): @@ -72,8 +72,8 @@ class Metadata(MetadataComponent): verbose (bool): Optional. Default to ``False``. Toggle exhaustive schema offence reporting. Schema: - format (:class:`~playground_plums.model.validation.metadata.Format`): The format metadata section. - model (:class:`~playground_plums.model.validation.metadata.Model`): The model metadata section. + format (:class:`~plums.model.validation.metadata.Format`): The format metadata section. + model (:class:`~plums.model.validation.metadata.Model`): The model metadata section. """ @@ -99,8 +99,8 @@ class Configuration(MetadataComponent): verbose (bool): Optional. Default to ``False``. Toggle exhaustive schema offence reporting. Schema: - path (:class:`~playground_plums.model.validation.schema_core.Path`): The configuration file path. - hash (:class:`~playground_plums.model.validation.schema_core.MD5Checksum`): The configuration file checksum. + path (:class:`~plums.model.validation.schema_core.Path`): The configuration file path. + hash (:class:`~plums.model.validation.schema_core.MD5Checksum`): The configuration file checksum. """ @@ -124,7 +124,7 @@ class InitialisationPMF(MetadataComponent): name (:class:`str`, ``None``): The initialisation |Model| name. id (:class:`str`): The initialisation |Model| id. checkpoint (:class:`str`, :class:`int`): The initialisation |Model| checkpoint reference used to initialise. - path (:class:`~playground_plums.model.validation.schema_core.Path`): The initialisation |Model| location. + path (:class:`~plums.model.validation.schema_core.Path`): The initialisation |Model| location. """ @@ -150,8 +150,8 @@ class InitialisationPath(MetadataComponent): Schema: name (:class:`str`, ``None``): The initialisation name. - path (:class:`~playground_plums.model.validation.schema_core.Path`): The initialisation file path. - hash (:class:`~playground_plums.model.validation.schema_core.MD5Checksum`): The initialisation file checksum. + path (:class:`~plums.model.validation.schema_core.Path`): The initialisation file path. + hash (:class:`~plums.model.validation.schema_core.MD5Checksum`): The initialisation file checksum. """ @@ -217,11 +217,11 @@ class Model(MetadataComponent): Schema: name (:class:`str`, ``None``): The |Model| name. id (:class:`str`): The |Model| name. - initialisation (:class:`~playground_plums.model.validation.metadata.Initialisation`): + initialisation (:class:`~plums.model.validation.metadata.Initialisation`): The |Model| initialisation section. - training (:class:`~playground_plums.model.validation.metadata.Training`): + training (:class:`~plums.model.validation.metadata.Training`): The |Model| training section. - configuration (:class:`~playground_plums.model.validation.metadata.Configuration`): + configuration (:class:`~plums.model.validation.metadata.Configuration`): The |Model| configuration section. """ @@ -256,8 +256,8 @@ class Checkpoint(DefaultMetadata): Schema: epoch (:class:`int`): The |Checkpoint| epoch. - path (:class:`~playground_plums.model.validation.schema_core.Path`): The |Checkpoint| file path. - hash (:class:`~playground_plums.model.validation.schema_core.MD5Checksum`): The |Checkpoint| file checksum. + path (:class:`~plums.model.validation.schema_core.Path`): The |Checkpoint| file path. + hash (:class:`~plums.model.validation.schema_core.MD5Checksum`): The |Checkpoint| file checksum. """ @@ -292,7 +292,7 @@ class Training(MetadataComponent): end_epoch (:class:`int`, :class:`float`, ``None``): The |Training| ending epoch number. latest (:class:`str`, :class:`int`): A reference to the latest registered |Checkpoint| in the |CheckpointSchema| section. - checkpoint (:class:`~playground_plums.model.validation.metadata.Configuration`): + checkpoint (:class:`~plums.model.validation.metadata.Configuration`): The |Training| checkpoints section. """ @@ -456,7 +456,7 @@ class Producer(MetadataComponent): Schema: name (:class:`str`): The |Producer| name. - version (:class:`~playground_plums.model.validation.metadata.ProducerVersion`): The |Producer| version section. + version (:class:`~plums.model.validation.metadata.ProducerVersion`): The |Producer| version section. """ @@ -480,7 +480,7 @@ class Format(MetadataComponent): Schema: version (:class:`str`): The *PMF* format current version. - version (:class:`~playground_plums.model.validation.metadata.Producer`): The format producer section. + version (:class:`~plums.model.validation.metadata.Producer`): The format producer section. """ diff --git a/playground_plums/model/validation/schema_core.py b/plums/model/validation/schema_core.py similarity index 96% rename from playground_plums/model/validation/schema_core.py rename to plums/model/validation/schema_core.py index a3e7cc9..dd4e86b 100755 --- a/playground_plums/model/validation/schema_core.py +++ b/plums/model/validation/schema_core.py @@ -1,8 +1,8 @@ import schema -from playground_plums.commons.path import Path as PlumsPath -from playground_plums.model.exception import PlumsValidationError -from playground_plums.model.validation.utils.validate_path import is_pathname_valid +from plums.commons.path import Path as PlumsPath +from plums.model.exception import PlumsValidationError +from plums.model.validation.utils.validate_path import is_pathname_valid class SchemaComponent(object): diff --git a/playground_plums/model/validation/structure.py b/plums/model/validation/structure.py similarity index 98% rename from playground_plums/model/validation/structure.py rename to plums/model/validation/structure.py index 4819990..550b439 100755 --- a/playground_plums/model/validation/structure.py +++ b/plums/model/validation/structure.py @@ -1,13 +1,13 @@ import schema import yaml -from playground_plums.commons.path import Path -from playground_plums.model.exception import ( +from plums.commons.path import Path +from plums.model.exception import ( PlumsValidationError, PlumsModelTreeValidationError, PlumsModelMetadataValidationError ) -from playground_plums.model.validation.metadata import Metadata as MetadataSchema -from playground_plums.model.validation.schema_core import SchemaComponent, Default -from playground_plums.model.validation.utils.checksum import md5_checksum +from plums.model.validation.metadata import Metadata as MetadataSchema +from plums.model.validation.schema_core import SchemaComponent, Default +from plums.model.validation.utils.checksum import md5_checksum class TreeComponent(SchemaComponent): diff --git a/playground_plums/model/validation/utils/__init__.py b/plums/model/validation/utils/__init__.py similarity index 100% rename from playground_plums/model/validation/utils/__init__.py rename to plums/model/validation/utils/__init__.py diff --git a/playground_plums/model/validation/utils/checksum.py b/plums/model/validation/utils/checksum.py similarity index 100% rename from playground_plums/model/validation/utils/checksum.py rename to plums/model/validation/utils/checksum.py diff --git a/playground_plums/model/validation/utils/dict_from_tree.py b/plums/model/validation/utils/dict_from_tree.py similarity index 95% rename from playground_plums/model/validation/utils/dict_from_tree.py rename to plums/model/validation/utils/dict_from_tree.py index 1b986f5..04a7b02 100755 --- a/playground_plums/model/validation/utils/dict_from_tree.py +++ b/plums/model/validation/utils/dict_from_tree.py @@ -1,4 +1,4 @@ -from playground_plums.commons.path import Path +from plums.commons.path import Path def make_dict_structure_from_tree(path): diff --git a/playground_plums/model/validation/utils/validate_path.py b/plums/model/validation/utils/validate_path.py similarity index 100% rename from playground_plums/model/validation/utils/validate_path.py rename to plums/model/validation/utils/validate_path.py diff --git a/playground_plums/plot/__init__.py b/plums/plot/__init__.py similarity index 100% rename from playground_plums/plot/__init__.py rename to plums/plot/__init__.py diff --git a/playground_plums/plot/engine/__init__.py b/plums/plot/engine/__init__.py similarity index 100% rename from playground_plums/plot/engine/__init__.py rename to plums/plot/engine/__init__.py diff --git a/playground_plums/plot/engine/color/__init__.py b/plums/plot/engine/color/__init__.py similarity index 100% rename from playground_plums/plot/engine/color/__init__.py rename to plums/plot/engine/color/__init__.py diff --git a/playground_plums/plot/engine/color/color.py b/plums/plot/engine/color/color.py similarity index 100% rename from playground_plums/plot/engine/color/color.py rename to plums/plot/engine/color/color.py diff --git a/playground_plums/plot/engine/color/color_map.py b/plums/plot/engine/color/color_map.py similarity index 98% rename from playground_plums/plot/engine/color/color_map.py rename to plums/plot/engine/color/color_map.py index 862099c..578a3e4 100755 --- a/playground_plums/plot/engine/color/color_map.py +++ b/plums/plot/engine/color/color_map.py @@ -3,8 +3,8 @@ import numpy as np -from playground_plums.plot.engine.utils import dict_equal -from playground_plums.plot.engine.color.color import Color +from plums.plot.engine.utils import dict_equal +from plums.plot.engine.color.color import Color def identity(x): @@ -92,10 +92,10 @@ def __call__(self, array, keep_colors=False): Args: array (:class:`~numpy.ndarray`): An array on which to apply the color map. keep_colors (bool): Optional. Default to ``False``. If ``True``, returns an array of |Color|, otherwise, an - :class:`~np.ndarray` of :attr:`~playground_plums.plot.color.color.Color.components` is returned. + :class:`~np.ndarray` of :attr:`~plums.plot.color.color.Color.components` is returned. Returns: - :class:`~numpy.ndarray`: An array of |Color| or :attr:`~playground_plums.plot.color.color.Color.components` + :class:`~numpy.ndarray`: An array of |Color| or :attr:`~plums.plot.color.color.Color.components` corresponding to values in ``array``. """ diff --git a/playground_plums/plot/engine/color_engine.py b/plums/plot/engine/color_engine.py similarity index 99% rename from playground_plums/plot/engine/color_engine.py rename to plums/plot/engine/color_engine.py index c7e6b10..df013b6 100755 --- a/playground_plums/plot/engine/color_engine.py +++ b/plums/plot/engine/color_engine.py @@ -3,9 +3,9 @@ import ordered_set -from playground_plums.plot.engine.descriptor import Descriptor -from playground_plums.plot.engine.color import CategoricalColorMap, LightnessColorMap, Color -from playground_plums.commons.data import RecordCollection +from plums.plot.engine.descriptor import Descriptor +from plums.plot.engine.color import CategoricalColorMap, LightnessColorMap, Color +from plums.commons.data import RecordCollection class CategoricalRecordCollection(RecordCollection): diff --git a/playground_plums/plot/engine/compositor.py b/plums/plot/engine/compositor.py similarity index 97% rename from playground_plums/plot/engine/compositor.py rename to plums/plot/engine/compositor.py index 9c764b6..ea34b51 100755 --- a/playground_plums/plot/engine/compositor.py +++ b/plums/plot/engine/compositor.py @@ -5,11 +5,11 @@ import PIL.Image import PIL.ImageDraw -from playground_plums.commons import DataPoint -from playground_plums.plot.engine.painter import Draw, Painter -from playground_plums.plot.engine.legend_painter import LegendPainter -from playground_plums.plot.engine.utils import get_default_font, get_text_color -from playground_plums.plot.engine.position_generator import ( +from plums.commons import DataPoint +from plums.plot.engine.painter import Draw, Painter +from plums.plot.engine.legend_painter import LegendPainter +from plums.plot.engine.utils import get_default_font, get_text_color +from plums.plot.engine.position_generator import ( AdaptiveImagePositionGenerator, LayoutImagePositionGenerator, SimpleImagePositionGenerator ) diff --git a/playground_plums/plot/engine/descriptor.py b/plums/plot/engine/descriptor.py similarity index 96% rename from playground_plums/plot/engine/descriptor.py rename to plums/plot/engine/descriptor.py index 4974174..d92fedc 100755 --- a/playground_plums/plot/engine/descriptor.py +++ b/plums/plot/engine/descriptor.py @@ -5,9 +5,9 @@ import numpy as np from ordered_set import OrderedSet -from playground_plums.plot.engine.utils import dict_equal -from playground_plums.plot.engine.color import Color -from playground_plums.plot.engine.color.color_map import ColorMap, identity +from plums.plot.engine.utils import dict_equal +from plums.plot.engine.color import Color +from plums.plot.engine.color.color_map import ColorMap, identity _camel_to_snake_re1 = re.compile('(.)([A-Z][a-z]+)') _camel_to_snake_re2 = re.compile('([a-z0-9])([A-Z])') @@ -452,7 +452,7 @@ def reset(self): class Labels(CategoricalDescriptor): - """Extract a categorical property from :attr:`~playground_plums.commons.data.record.Record.labels`.""" + """Extract a categorical property from :attr:`~plums.commons.data.record.Record.labels`.""" def __init__(self): super(Labels, self).__init__(name='labels', fetch_fn=self._fetch_fn) @@ -463,7 +463,7 @@ def _fetch_fn(labels): class Confidence(ContinuousDescriptor): - """Extract a continuous property from :attr:`~playground_plums.commons.data.record.Record.confidence`. + """Extract a continuous property from :attr:`~plums.commons.data.record.Record.confidence`. Args: scale (tuple): Optional. Default to ``None``. If given, it must be an interval :math:`[a, b]` over which the @@ -476,7 +476,7 @@ def __init__(self, scale=None): class IntervalConfidence(IntervalDescriptor): - """Extract a interval property from :attr:`~playground_plums.commons.data.record.Record.confidence`. + """Extract a interval property from :attr:`~plums.commons.data.record.Record.confidence`. Args: n (int): Optional. Default to ``5``.The number of bins used to categorise the continuous property. @@ -505,7 +505,7 @@ def _area(coordinates): class Area(ContinuousDescriptor): - """Extract an area property from :attr:`~playground_plums.commons.data.record.Record.coordinates`. + """Extract an area property from :attr:`~plums.commons.data.record.Record.coordinates`. Args: scale (tuple): Optional. Default to ``None``. If given, it must be an interval :math:`[a, b]` over which the @@ -545,7 +545,7 @@ def __descriptor__(self): # noqa: D401 class IntervalArea(IntervalDescriptor): - """Extract an area property from :attr:`~playground_plums.commons.data.record.Record.coordinates`. + """Extract an area property from :attr:`~plums.commons.data.record.Record.coordinates`. Args: n (int): Optional. Default to ``5``.The number of bins used to categorise the continuous property. diff --git a/playground_plums/plot/engine/fonts/arial.ttf b/plums/plot/engine/fonts/arial.ttf similarity index 100% rename from playground_plums/plot/engine/fonts/arial.ttf rename to plums/plot/engine/fonts/arial.ttf diff --git a/playground_plums/plot/engine/legend_painter.py b/plums/plot/engine/legend_painter.py similarity index 98% rename from playground_plums/plot/engine/legend_painter.py rename to plums/plot/engine/legend_painter.py index 7c78606..3b65652 100755 --- a/playground_plums/plot/engine/legend_painter.py +++ b/plums/plot/engine/legend_painter.py @@ -5,12 +5,12 @@ import PIL.Image import PIL.ImageDraw -from playground_plums.commons import Record, RecordCollection -from playground_plums.plot.engine.painter import TagPainter, Draw -from playground_plums.plot.engine.color import Color, color_map -from playground_plums.plot.engine.position_generator import LegendItemPositionGenerator -from playground_plums.plot.engine.utils import get_default_font, get_outline_color, get_text_color -from playground_plums.plot.engine.descriptor import Confidence, CategoricalDescriptor +from plums.commons import Record, RecordCollection +from plums.plot.engine.painter import TagPainter, Draw +from plums.plot.engine.color import Color, color_map +from plums.plot.engine.position_generator import LegendItemPositionGenerator +from plums.plot.engine.utils import get_default_font, get_outline_color, get_text_color +from plums.plot.engine.descriptor import Confidence, CategoricalDescriptor class LegendItemDrawer(object): diff --git a/playground_plums/plot/engine/orchestrator.py b/plums/plot/engine/orchestrator.py similarity index 98% rename from playground_plums/plot/engine/orchestrator.py rename to plums/plot/engine/orchestrator.py index b4458f3..c8dc567 100755 --- a/playground_plums/plot/engine/orchestrator.py +++ b/plums/plot/engine/orchestrator.py @@ -1,6 +1,6 @@ -from playground_plums.commons import PropertyContainer, DataPoint, Annotation, Tile, RecordCollection -from playground_plums.plot.engine.color_engine import ColorEngine -from playground_plums.plot.engine.compositor import Compositor +from plums.commons import PropertyContainer, DataPoint, Annotation, Tile, RecordCollection +from plums.plot.engine.color_engine import ColorEngine +from plums.plot.engine.compositor import Compositor class OrchestratorBase(PropertyContainer): diff --git a/playground_plums/plot/engine/painter.py b/plums/plot/engine/painter.py similarity index 99% rename from playground_plums/plot/engine/painter.py rename to plums/plot/engine/painter.py index 8e68839..af52966 100755 --- a/playground_plums/plot/engine/painter.py +++ b/plums/plot/engine/painter.py @@ -6,7 +6,7 @@ import PIL.ImageDraw import PIL.ImageFont -from playground_plums.plot.engine.utils import get_default_font, get_text_color +from plums.plot.engine.utils import get_default_font, get_text_color class Position(object): diff --git a/playground_plums/plot/engine/position_generator.py b/plums/plot/engine/position_generator.py similarity index 100% rename from playground_plums/plot/engine/position_generator.py rename to plums/plot/engine/position_generator.py diff --git a/playground_plums/plot/engine/utils.py b/plums/plot/engine/utils.py similarity index 98% rename from playground_plums/plot/engine/utils.py rename to plums/plot/engine/utils.py index b7e79b3..0209b4a 100755 --- a/playground_plums/plot/engine/utils.py +++ b/plums/plot/engine/utils.py @@ -1,7 +1,7 @@ import PIL.ImageFont import numpy as np -from playground_plums.commons import Path +from plums.commons import Path def get_text_color(background_color): diff --git a/playground_plums/plot/plot.py b/plums/plot/plot.py similarity index 98% rename from playground_plums/plot/plot.py rename to plums/plot/plot.py index dce5097..a6a6714 100755 --- a/playground_plums/plot/plot.py +++ b/plums/plot/plot.py @@ -1,8 +1,8 @@ from abc import ABC, abstractmethod -from playground_plums.commons import Path, RecordCollection -from playground_plums.plot.engine.descriptor import CategoricalDescriptor -from playground_plums.plot.engine.orchestrator import Orchestrator +from plums.commons import Path, RecordCollection +from plums.plot.engine.descriptor import CategoricalDescriptor +from plums.plot.engine.orchestrator import Orchestrator class Plot(ABC): diff --git a/setup.cfg b/setup.cfg index 21ddbf8..fe3955f 100755 --- a/setup.cfg +++ b/setup.cfg @@ -9,10 +9,10 @@ exclude = .git, docs/source/conf.py, build, dist, - playground_plums/dataflow/io/tile/_vendor/turbojpeg.py + plums/dataflow/io/tile/_vendor/turbojpeg.py radon-max-cc = 25 show-source = 1 -application-import-names = playground_plums +application-import-names = plums import-order-style = pep8 [bdist_wheel] diff --git a/setup.py b/setup.py index fb08bcd..df165d4 100755 --- a/setup.py +++ b/setup.py @@ -27,22 +27,33 @@ def _load_requirements(path_dir: str, file_name: str = "requirements.txt", comme return reqs -with io.open('playground_plums/__init__.py', 'rt', encoding='utf8') as f: +with io.open('plums/__init__.py', 'rt', encoding='utf8') as f: version = re.search(r'__version__ = \'(.*?)\'', f.read(), re.M).group(1) setup( - name='playground-plums', + name='plums', version=str(version), packages=find_packages(exclude=['tests', 'tests.*', 'docs', 'docs.*']), - author="Clement Maliet", - author_email="clement.maliet@magellium.fr", + author="Airbus DS GEO", + author_email="jeffaudi.airbus@gmail.com", description="Playground ML Unified Microlib Set: The Playground ML python toolbox package", + long_description=open("README.md", "r").read(), + long_description_content_type="text/markdown", license="MIT", include_package_data=True, zip_safe=False, + python_requires=">=3.6", classifiers=[ - 'Private :: Do Not Upload to pypi server', + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ], install_requires=_load_requirements(path_dir=os.path.join(PATH_ROOT), file_name="requirements.txt"), extras_require={ diff --git a/tests/test_commons/base.py b/tests/test_commons/base.py index 60748e4..b1ece4a 100755 --- a/tests/test_commons/base.py +++ b/tests/test_commons/base.py @@ -2,7 +2,7 @@ import pytest -from playground_plums.commons.data.mixin import PropertyContainer, IdentifiedMixIn +from plums.commons.data.mixin import PropertyContainer, IdentifiedMixIn def identified_suite(obj): diff --git a/tests/test_commons/test_data.py b/tests/test_commons/test_data.py index 33b3f38..9cb3021 100755 --- a/tests/test_commons/test_data.py +++ b/tests/test_commons/test_data.py @@ -5,9 +5,9 @@ import numpy as np from tests.test_commons.base import mixin_suite -import playground_plums.commons.data as data -import playground_plums.commons.data.mixin -from playground_plums.commons.data.taxonomy import Label, Taxonomy +import plums.commons.data as data +import plums.commons.data.mixin +from plums.commons.data.taxonomy import Label, Taxonomy @pytest.fixture(params=('ordered-dict', 'tile-collection')) @@ -68,11 +68,11 @@ def __geo_interface__(self): def test_property_container(self): # Check construction - p = playground_plums.commons.data.mixin.PropertyContainer() + p = plums.commons.data.mixin.PropertyContainer() mixin_suite(p) # Base validity tests def test_id_mixin(self): - id_ = playground_plums.commons.data.mixin.IdentifiedMixIn() + id_ = plums.commons.data.mixin.IdentifiedMixIn() mixin_suite(id_) # Base validity tests diff --git a/tests/test_commons/test_path.py b/tests/test_commons/test_path.py index aab37d2..3e65d7c 100755 --- a/tests/test_commons/test_path.py +++ b/tests/test_commons/test_path.py @@ -12,7 +12,7 @@ except ImportError: fspath = str -from playground_plums.commons.path import Path +from plums.commons.path import Path @pytest.fixture(params=["pathlib", "Path", "str"]) diff --git a/tests/test_commons/test_taxonomy.py b/tests/test_commons/test_taxonomy.py index 2237b29..5195ccc 100755 --- a/tests/test_commons/test_taxonomy.py +++ b/tests/test_commons/test_taxonomy.py @@ -5,7 +5,7 @@ import pytest from tests.test_commons.base import mixin_suite -from playground_plums.commons.data.taxonomy import Label, Tree, Taxonomy +from plums.commons.data.taxonomy import Label, Tree, Taxonomy @pytest.fixture() diff --git a/tests/test_dataflow/conftest.py b/tests/test_dataflow/conftest.py index d279afd..bf3334d 100755 --- a/tests/test_dataflow/conftest.py +++ b/tests/test_dataflow/conftest.py @@ -4,7 +4,7 @@ import pytest from appdirs import user_cache_dir -from playground_plums.commons.path import Path +from plums.commons.path import Path _tree_complex = { 'metadata.csv': '', diff --git a/tests/test_dataflow/test_dataset/test_base.py b/tests/test_dataflow/test_dataset/test_base.py index 6548e56..718db45 100755 --- a/tests/test_dataflow/test_dataset/test_base.py +++ b/tests/test_dataflow/test_dataset/test_base.py @@ -1,7 +1,7 @@ import pytest import numpy as np -from playground_plums.dataflow.dataset import Dataset, SizedDataset, Subset, ConcatDataset +from plums.dataflow.dataset import Dataset, SizedDataset, Subset, ConcatDataset class ConcreteDataset(Dataset): diff --git a/tests/test_dataflow/test_dataset/test_parser.py b/tests/test_dataflow/test_dataset/test_parser.py index 8f42f19..0f350ee 100755 --- a/tests/test_dataflow/test_dataset/test_parser.py +++ b/tests/test_dataflow/test_dataset/test_parser.py @@ -1,6 +1,6 @@ import pytest -from playground_plums.dataflow.utils.parser import Parser, ComponentResolver, GroupResolver, ExtensionResolver, \ +from plums.dataflow.utils.parser import Parser, ComponentResolver, GroupResolver, ExtensionResolver, \ PatternSyntaxError, InvalidGroupConstructSyntaxError, MissingGroupRegexSyntaxError, MissingGroupNameSyntaxError, \ MissingGroupOpeningSyntaxError, MissingGroupClosingSyntaxError, FileMissingSyntaxError, \ DuplicateSeparatorSyntaxError, InvalidNameSyntaxError, InvalidExtensionSyntaxError, DuplicateGroupError, \ diff --git a/tests/test_dataflow/test_dataset/test_path.py b/tests/test_dataflow/test_dataset/test_path.py index d34aa04..b1a451c 100755 --- a/tests/test_dataflow/test_dataset/test_path.py +++ b/tests/test_dataflow/test_dataset/test_path.py @@ -1,7 +1,7 @@ import pytest -from playground_plums.commons.path import Path -from playground_plums.dataflow.utils.path import PathResolver +from plums.commons.path import Path +from plums.dataflow.utils.path import PathResolver def test_resolver_init(): diff --git a/tests/test_dataflow/test_dataset/test_pattern.py b/tests/test_dataflow/test_dataset/test_pattern.py index 0286b07..bd889fe 100755 --- a/tests/test_dataflow/test_dataset/test_pattern.py +++ b/tests/test_dataflow/test_dataset/test_pattern.py @@ -3,8 +3,8 @@ import pytest import numpy as np -from playground_plums.commons.data import TileWrapper, Record, RecordCollection, DataPoint -from playground_plums.dataflow.dataset import PatternDataset +from plums.commons.data import TileWrapper, Record, RecordCollection, DataPoint +from plums.dataflow.dataset import PatternDataset def _dummy_tile_driver(paths, **matches): diff --git a/tests/test_dataflow/test_dataset/test_playground.py b/tests/test_dataflow/test_dataset/test_playground.py index becfe80..786b5a2 100755 --- a/tests/test_dataflow/test_dataset/test_playground.py +++ b/tests/test_dataflow/test_dataset/test_playground.py @@ -1,11 +1,11 @@ import pytest import numpy as np -from playground_plums.commons.path import Path -from playground_plums.commons.data import Taxonomy, Label, TileCollection -from playground_plums.dataflow.io import dump, RGB, BGR, Tile -from playground_plums.dataflow.io.tile._backend import Image -from playground_plums.dataflow.dataset.playground import PlaygroundDataset, TaxonomyReader, TileDriver, AnnotationDriver +from plums.commons.path import Path +from plums.commons.data import Taxonomy, Label, TileCollection +from plums.dataflow.io import dump, RGB, BGR, Tile +from plums.dataflow.io.tile._backend import Image +from plums.dataflow.dataset.playground import PlaygroundDataset, TaxonomyReader, TileDriver, AnnotationDriver @pytest.fixture() diff --git a/tests/test_dataflow/test_io/test_json.py b/tests/test_dataflow/test_io/test_json.py index 58f4828..908d8be 100755 --- a/tests/test_dataflow/test_io/test_json.py +++ b/tests/test_dataflow/test_io/test_json.py @@ -9,7 +9,7 @@ import pytest -from playground_plums.commons.path import Path +from plums.commons.path import Path @pytest.fixture(scope="module", params=('large', 'small')) @@ -40,7 +40,7 @@ class TestImport: @pytest.fixture(autouse=True) def clean_up(self): # Ugly cleanup - for module in [module for module in sys.modules if 'playground_plums.dataflow.io.json' in module]: + for module in [module for module in sys.modules if 'plums.dataflow.io.json' in module]: try: del sys.modules[module] except KeyError: @@ -62,31 +62,31 @@ def clean_up(self): def test_orjson_fail(self): with disable_import('orjson'): - import playground_plums.dataflow.io.json - assert not playground_plums.dataflow.io.json._HAS_ORJSON - assert playground_plums.dataflow.io.json._HAS_RAPIDJSON - assert playground_plums.dataflow.io.json._HAS_SIMPLEJSON + import plums.dataflow.io.json + assert not plums.dataflow.io.json._HAS_ORJSON + assert plums.dataflow.io.json._HAS_RAPIDJSON + assert plums.dataflow.io.json._HAS_SIMPLEJSON def test_rapidjson_fail(self): with disable_import('rapidjson'): - import playground_plums.dataflow.io.json - assert playground_plums.dataflow.io.json._HAS_ORJSON - assert not playground_plums.dataflow.io.json._HAS_RAPIDJSON - assert playground_plums.dataflow.io.json._HAS_SIMPLEJSON + import plums.dataflow.io.json + assert plums.dataflow.io.json._HAS_ORJSON + assert not plums.dataflow.io.json._HAS_RAPIDJSON + assert plums.dataflow.io.json._HAS_SIMPLEJSON def test_simplejson_fail(self): with disable_import('simplejson'): - import playground_plums.dataflow.io.json - assert playground_plums.dataflow.io.json._HAS_ORJSON - assert playground_plums.dataflow.io.json._HAS_RAPIDJSON - assert not playground_plums.dataflow.io.json._HAS_SIMPLEJSON + import plums.dataflow.io.json + assert plums.dataflow.io.json._HAS_ORJSON + assert plums.dataflow.io.json._HAS_RAPIDJSON + assert not plums.dataflow.io.json._HAS_SIMPLEJSON class TestIO: @pytest.fixture(autouse=True) def clean_up(self): # Ugly cleanup - for module in [module for module in sys.modules if 'playground_plums.dataflow.io.json' in module]: + for module in [module for module in sys.modules if 'plums.dataflow.io.json' in module]: try: del sys.modules[module] except KeyError: @@ -113,7 +113,7 @@ def clean_up(self): ('orjson', 'simplejson')), ids=lambda backends: ', '.join(backends)) def test_load(self, disabled_backend, json_file, data): with disable_import(*disabled_backend): - from playground_plums.dataflow.io.json import load + from plums.dataflow.io.json import load test_data = load(json_file) assert data == test_data @@ -125,7 +125,7 @@ def test_load(self, disabled_backend, json_file, data): ('orjson', 'simplejson')), ids=lambda backends: ', '.join(backends)) def test_save(self, disabled_backend, json_file, data, tmp_path): with disable_import(*disabled_backend): - from playground_plums.dataflow.io.json import load, dump + from plums.dataflow.io.json import load, dump dump(data, str(tmp_path / 'test.json')) test_data = load(str(tmp_path / 'test.json')) diff --git a/tests/test_dataflow/test_io/test_tile/test_backend.py b/tests/test_dataflow/test_io/test_tile/test_backend.py index af40e09..7cb5324 100755 --- a/tests/test_dataflow/test_io/test_tile/test_backend.py +++ b/tests/test_dataflow/test_io/test_tile/test_backend.py @@ -5,7 +5,7 @@ import pytest import numpy as np -from playground_plums.commons.path import Path +from plums.commons.path import Path @pytest.fixture(params=('ext', 'no_ext')) @@ -67,7 +67,7 @@ class TestImport: @pytest.fixture(autouse=True) def clean_up(self): # Ugly cleanup - for module in [module for module in sys.modules if 'playground_plums.dataflow.io.tile._backend' in module]: + for module in [module for module in sys.modules if 'plums.dataflow.io.tile._backend' in module]: try: del sys.modules[module] except KeyError: @@ -92,50 +92,50 @@ def clean_up(self): yield def test_all_fail(self): - with pytest.raises(ImportError, match='Error importing playground_plums.dataflow.io: ' + with pytest.raises(ImportError, match='Error importing plums.dataflow.io: ' 'No suitable image backend where found. ' 'For more information, please refer to the documentation.'): - with disable_import('PIL', 'lycon', 'cv2', 'playground_plums.dataflow.io.tile._vendor.turbojpeg'): - import playground_plums.dataflow.io.tile._backend # noqa: F401 + with disable_import('PIL', 'lycon', 'cv2', 'plums.dataflow.io.tile._vendor.turbojpeg'): + import plums.dataflow.io.tile._backend # noqa: F401 def test_pillow_fail(self): with disable_import('PIL'): - import playground_plums.dataflow.io.tile._backend - assert not playground_plums.dataflow.io.tile._backend._HAS_PILLOW - assert playground_plums.dataflow.io.tile._backend._HAS_LYCON - assert playground_plums.dataflow.io.tile._backend._HAS_CV2 - assert playground_plums.dataflow.io.tile._backend._HAS_TURBO_JPEG + import plums.dataflow.io.tile._backend + assert not plums.dataflow.io.tile._backend._HAS_PILLOW + assert plums.dataflow.io.tile._backend._HAS_LYCON + assert plums.dataflow.io.tile._backend._HAS_CV2 + assert plums.dataflow.io.tile._backend._HAS_TURBO_JPEG def test_lycon_fail(self): with disable_import('lycon'): - import playground_plums.dataflow.io.tile._backend - assert playground_plums.dataflow.io.tile._backend._HAS_PILLOW - assert not playground_plums.dataflow.io.tile._backend._HAS_LYCON - assert playground_plums.dataflow.io.tile._backend._HAS_CV2 - assert playground_plums.dataflow.io.tile._backend._HAS_TURBO_JPEG + import plums.dataflow.io.tile._backend + assert plums.dataflow.io.tile._backend._HAS_PILLOW + assert not plums.dataflow.io.tile._backend._HAS_LYCON + assert plums.dataflow.io.tile._backend._HAS_CV2 + assert plums.dataflow.io.tile._backend._HAS_TURBO_JPEG def test_onpen_cv_fail(self): with disable_import('cv2'): - import playground_plums.dataflow.io.tile._backend - assert playground_plums.dataflow.io.tile._backend._HAS_PILLOW - assert playground_plums.dataflow.io.tile._backend._HAS_LYCON - assert not playground_plums.dataflow.io.tile._backend._HAS_CV2 - assert playground_plums.dataflow.io.tile._backend._HAS_TURBO_JPEG + import plums.dataflow.io.tile._backend + assert plums.dataflow.io.tile._backend._HAS_PILLOW + assert plums.dataflow.io.tile._backend._HAS_LYCON + assert not plums.dataflow.io.tile._backend._HAS_CV2 + assert plums.dataflow.io.tile._backend._HAS_TURBO_JPEG def test_turbo_jpeg_fail(self): - with disable_import('playground_plums.dataflow.io.tile._vendor.turbojpeg'): - import playground_plums.dataflow.io.tile._backend - assert playground_plums.dataflow.io.tile._backend._HAS_PILLOW - assert playground_plums.dataflow.io.tile._backend._HAS_LYCON - assert playground_plums.dataflow.io.tile._backend._HAS_CV2 - assert not playground_plums.dataflow.io.tile._backend._HAS_TURBO_JPEG + with disable_import('plums.dataflow.io.tile._vendor.turbojpeg'): + import plums.dataflow.io.tile._backend + assert plums.dataflow.io.tile._backend._HAS_PILLOW + assert plums.dataflow.io.tile._backend._HAS_LYCON + assert plums.dataflow.io.tile._backend._HAS_CV2 + assert not plums.dataflow.io.tile._backend._HAS_TURBO_JPEG class TestLoad: @pytest.fixture(autouse=True) def clean_up(self): # Ugly cleanup - for module in [module for module in sys.modules if 'playground_plums.dataflow.io.tile._backend' in module]: + for module in [module for module in sys.modules if 'plums.dataflow.io.tile._backend' in module]: try: del sys.modules[module] except KeyError: @@ -159,52 +159,52 @@ def clean_up(self): yield - @pytest.mark.parametrize('disabled_backend', (('none', ), ('playground_plums.dataflow.io.tile._vendor.turbojpeg', ), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + @pytest.mark.parametrize('disabled_backend', (('none', ), ('plums.dataflow.io.tile._vendor.turbojpeg', ), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'cv2'), ('lycon', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + ('plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'PIL'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), ('lycon', 'cv2', 'PIL'), ('lycon', 'PIL'), ('cv2', 'PIL')), ids=lambda backends: ', '.join(backends)) def test_jpeg_ext(self, disabled_backend): with disable_import(*disabled_backend): - from playground_plums.dataflow.io.tile._backend import _load_jpg + from plums.dataflow.io.tile._backend import _load_jpg array = _load_jpg(Path(__file__)[:-1] / '_data/test_jpg.jpg') array_noext = _load_jpg(Path(__file__)[:-1] / '_data/test_jpg') assert np.array_equal(array, array_noext) def test_jpeg_no_backend(self): - with disable_import('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'cv2'): - import playground_plums.dataflow.io.tile._backend + with disable_import('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'cv2'): + import plums.dataflow.io.tile._backend # Disable Pillow after import to avoid early raise - playground_plums.dataflow.io.tile._backend._HAS_PILLOW = False + plums.dataflow.io.tile._backend._HAS_PILLOW = False with pytest.raises(RuntimeError, match='No backend available to open JPG image.'): - playground_plums.dataflow.io.tile._backend._load_jpg(Path(__file__)[:-1] / '_data/test_jpg.jpg') + plums.dataflow.io.tile._backend._load_jpg(Path(__file__)[:-1] / '_data/test_jpg.jpg') with pytest.raises(RuntimeError, match='No backend available to open JPG image.'): - playground_plums.dataflow.io.tile._backend._load_jpg(Path(__file__)[:-1] / '_data/test_jpg') + plums.dataflow.io.tile._backend._load_jpg(Path(__file__)[:-1] / '_data/test_jpg') - @pytest.mark.parametrize('disabled_backend', (('none', ), ('playground_plums.dataflow.io.tile._vendor.turbojpeg', ), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + @pytest.mark.parametrize('disabled_backend', (('none', ), ('plums.dataflow.io.tile._vendor.turbojpeg', ), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'cv2'), ('lycon', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + ('plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'PIL'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), ('lycon', 'PIL'), ('cv2', 'PIL')), ids=lambda backends: ', '.join(backends)) def test_png_ext(self, disabled_backend): with disable_import(*disabled_backend): - from playground_plums.dataflow.io.tile._backend import _load_png + from plums.dataflow.io.tile._backend import _load_png array = _load_png(Path(__file__)[:-1] / '_data/test_png.png') array_noext = _load_png(Path(__file__)[:-1] / '_data/test_png') @@ -212,27 +212,27 @@ def test_png_ext(self, disabled_backend): def test_png_no_backend(self): with disable_import('lycon', 'cv2', 'PIL'): - import playground_plums.dataflow.io.tile._backend + import plums.dataflow.io.tile._backend with pytest.raises(RuntimeError, match='No backend available to open PNG image.'): - playground_plums.dataflow.io.tile._backend._load_png(Path(__file__)[:-1] / '_data/test_png.png') + plums.dataflow.io.tile._backend._load_png(Path(__file__)[:-1] / '_data/test_png.png') with pytest.raises(RuntimeError, match='No backend available to open PNG image.'): - playground_plums.dataflow.io.tile._backend._load_png(Path(__file__)[:-1] / '_data/test_png') + plums.dataflow.io.tile._backend._load_png(Path(__file__)[:-1] / '_data/test_png') - @pytest.mark.parametrize('disabled_backend', (('none', ), ('playground_plums.dataflow.io.tile._vendor.turbojpeg', ), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + @pytest.mark.parametrize('disabled_backend', (('none', ), ('plums.dataflow.io.tile._vendor.turbojpeg', ), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'cv2'), ('lycon', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + ('plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'PIL'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), ('lycon', 'PIL'), ('cv2', 'PIL')), ids=lambda backends: ', '.join(backends)) def test_png_jpg(self, disabled_backend): with disable_import(*disabled_backend): - from playground_plums.dataflow.io.tile._backend import _load_png, _load_jpg + from plums.dataflow.io.tile._backend import _load_png, _load_jpg array_png = _load_png(Path(__file__)[:-1] / '_data/test_png.png').astype(np.float64) array_noext_png = _load_png(Path(__file__)[:-1] / '_data/test_png').astype(np.float64) array_jpg = _load_jpg(Path(__file__)[:-1] / '_data/test_jpg.jpg').astype(np.float64) @@ -248,7 +248,7 @@ class TestDump: @pytest.fixture(autouse=True) def clean_up(self): # Ugly cleanup - for module in [module for module in sys.modules if 'playground_plums.dataflow.io.tile._backend' in module]: + for module in [module for module in sys.modules if 'plums.dataflow.io.tile._backend' in module]: try: del sys.modules[module] except KeyError: @@ -272,42 +272,42 @@ def clean_up(self): yield - @pytest.mark.parametrize('disabled_backend', (('none', ), ('playground_plums.dataflow.io.tile._vendor.turbojpeg', ), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + @pytest.mark.parametrize('disabled_backend', (('none', ), ('plums.dataflow.io.tile._vendor.turbojpeg', ), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'cv2'), ('lycon', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + ('plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'PIL'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), ('lycon', 'cv2', 'PIL'), ('lycon', 'PIL'), ('cv2', 'PIL')), ids=lambda backends: ', '.join(backends)) def test_dump_jpg(self, disabled_backend, jpeg_image, tmp_path): image_path = tmp_path / 'test.jpg' with disable_import(*disabled_backend): - from playground_plums.dataflow.io.tile._backend import _dump_jpg, _load_jpg + from plums.dataflow.io.tile._backend import _dump_jpg, _load_jpg loaded = _load_jpg(jpeg_image) _dump_jpg(image_path, loaded) reloaded = _load_jpg(image_path) assert psnr(loaded.astype(np.float64), reloaded.astype(np.float64)) > 31 - @pytest.mark.parametrize('disabled_backend', (('none',), ('playground_plums.dataflow.io.tile._vendor.turbojpeg',), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + @pytest.mark.parametrize('disabled_backend', (('none',), ('plums.dataflow.io.tile._vendor.turbojpeg',), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'cv2'), ('lycon', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + ('plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'PIL'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), ('lycon', 'PIL'), ('cv2', 'PIL')), ids=lambda backends: ', '.join(backends)) def test_dump_png(self, disabled_backend, jpeg_image, tmp_path): image_path = tmp_path / 'test.png' with disable_import(*disabled_backend): - from playground_plums.dataflow.io.tile._backend import _dump_png, _load_png + from plums.dataflow.io.tile._backend import _dump_png, _load_png loaded = _load_png(jpeg_image) _dump_png(image_path, loaded) reloaded = _load_png(image_path) @@ -318,7 +318,7 @@ class TestImage: @pytest.fixture(autouse=True) def clean_up(self): # Ugly cleanup - for module in [module for module in sys.modules if 'playground_plums.dataflow.io.tile._backend' in module]: + for module in [module for module in sys.modules if 'plums.dataflow.io.tile._backend' in module]: try: del sys.modules[module] except KeyError: @@ -342,79 +342,79 @@ def clean_up(self): yield - @pytest.mark.parametrize('disabled_backend', (('none',), ('playground_plums.dataflow.io.tile._vendor.turbojpeg',), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + @pytest.mark.parametrize('disabled_backend', (('none',), ('plums.dataflow.io.tile._vendor.turbojpeg',), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'cv2'), ('lycon', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + ('plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'PIL'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), ('lycon', 'PIL'), ('cv2', 'PIL')), ids=lambda backends: ', '.join(backends)) def test_load(self, disabled_backend, image): with disable_import(*disabled_backend): - from playground_plums.dataflow.io.tile._backend import Image, _load_jpg, _load_png + from plums.dataflow.io.tile._backend import Image, _load_jpg, _load_png load = _load_png if 'png' in str(image) else _load_jpg assert np.array_equal(Image.load(image)._array_data, load(image)) - @pytest.mark.parametrize('disabled_backend', (('none',), ('playground_plums.dataflow.io.tile._vendor.turbojpeg',), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + @pytest.mark.parametrize('disabled_backend', (('none',), ('plums.dataflow.io.tile._vendor.turbojpeg',), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'cv2'), ('lycon', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + ('plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'PIL'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), ('lycon', 'PIL'), ('cv2', 'PIL')), ids=lambda backends: ', '.join(backends)) def test_dump_ext_input(self, disabled_backend, image_ext, tmp_path): image_path = tmp_path / ('test' + image_ext.ext) with disable_import(*disabled_backend): - from playground_plums.dataflow.io.tile._backend import Image + from plums.dataflow.io.tile._backend import Image Image.load(image_ext).save(image_path) assert psnr(Image.load(image_ext)._array_data, Image.load(image_path)._array_data) > 35 - @pytest.mark.parametrize('disabled_backend', (('none',), ('playground_plums.dataflow.io.tile._vendor.turbojpeg',), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + @pytest.mark.parametrize('disabled_backend', (('none',), ('plums.dataflow.io.tile._vendor.turbojpeg',), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'cv2'), ('lycon', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + ('plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'PIL'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), ('lycon', 'PIL'), ('cv2', 'PIL')), ids=lambda backends: ', '.join(backends)) def test_dump_no_ext_input(self, disabled_backend, image_no_ext, tmp_path): image_path = tmp_path / ('test' + '.jpg') with disable_import(*disabled_backend): - from playground_plums.dataflow.io.tile._backend import Image + from plums.dataflow.io.tile._backend import Image Image.load(image_no_ext).save(image_path) assert psnr(Image.load(image_no_ext)._array_data, Image.load(image_path)._array_data) > 34 image_path = tmp_path / ('test' + '.png') with disable_import(*disabled_backend): - from playground_plums.dataflow.io.tile._backend import Image + from plums.dataflow.io.tile._backend import Image Image.load(image_no_ext).save(image_path) assert psnr(Image.load(image_no_ext)._array_data, Image.load(image_path)._array_data) > 34 - @pytest.mark.parametrize('disabled_backend', (('none',), ('playground_plums.dataflow.io.tile._vendor.turbojpeg',), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + @pytest.mark.parametrize('disabled_backend', (('none',), ('plums.dataflow.io.tile._vendor.turbojpeg',), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'cv2'), ('lycon', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', + ('plums.dataflow.io.tile._vendor.turbojpeg', 'cv2'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'lycon', 'PIL'), - ('playground_plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), + ('plums.dataflow.io.tile._vendor.turbojpeg', 'PIL'), ('lycon', 'PIL'), ('cv2', 'PIL')), ids=lambda backends: ', '.join(backends)) def test_dump_no_ext(self, disabled_backend, image, tmp_path): image_path = tmp_path / 'test' with disable_import(*disabled_backend): - from playground_plums.dataflow.io.tile._backend import Image + from plums.dataflow.io.tile._backend import Image with pytest.raises(ValueError, match='Unsupported image type'): Image.load(image).save(image_path) diff --git a/tests/test_dataflow/test_io/test_tile/test_ptype.py b/tests/test_dataflow/test_io/test_tile/test_ptype.py index 78ada58..e4e6b63 100755 --- a/tests/test_dataflow/test_io/test_tile/test_ptype.py +++ b/tests/test_dataflow/test_io/test_tile/test_ptype.py @@ -1,8 +1,8 @@ import pytest import numpy as np -from playground_plums.dataflow.io.tile._format.channels import Channel, channels_register, Red, Green, Blue, Grey, Alpha -from playground_plums.dataflow.io.tile._format import ptype, rgb, rgba, bgr, bgra, y +from plums.dataflow.io.tile._format.channels import Channel, channels_register, Red, Green, Blue, Grey, Alpha +from plums.dataflow.io.tile._format import ptype, rgb, rgba, bgr, bgra, y def make_channel(value): diff --git a/tests/test_dataflow/test_io/test_tile/test_tile.py b/tests/test_dataflow/test_io/test_tile/test_tile.py index f408dd0..a7a754a 100755 --- a/tests/test_dataflow/test_io/test_tile/test_tile.py +++ b/tests/test_dataflow/test_io/test_tile/test_tile.py @@ -1,8 +1,8 @@ import pytest import numpy as np -from playground_plums.commons.path import Path -from playground_plums.dataflow.io.tile import Tile, rgb, rgba, bgr, bgra, y +from plums.commons.path import Path +from plums.dataflow.io.tile import Tile, rgb, rgba, bgr, bgra, y @pytest.fixture(params=('ext', 'no_ext')) diff --git a/tests/test_dataflow/test_io/test_tile/test_turbo_jpeg.py b/tests/test_dataflow/test_io/test_tile/test_turbo_jpeg.py index 98d258b..4932654 100755 --- a/tests/test_dataflow/test_io/test_tile/test_turbo_jpeg.py +++ b/tests/test_dataflow/test_io/test_tile/test_turbo_jpeg.py @@ -3,7 +3,7 @@ import numpy as np import cv2 -from playground_plums.dataflow.io.tile._vendor.turbojpeg import TurboJPEG, TJPF, TJSAMP +from plums.dataflow.io.tile._vendor.turbojpeg import TurboJPEG, TJPF, TJSAMP def phash_compare(img1, img2): diff --git a/tests/test_model/conftest.py b/tests/test_model/conftest.py index c2f328d..89aebd8 100755 --- a/tests/test_model/conftest.py +++ b/tests/test_model/conftest.py @@ -3,7 +3,7 @@ import pytest import yaml -from playground_plums.commons.path import Path +from plums.commons.path import Path @contextmanager diff --git a/tests/test_model/schema_validation/test_metadata.py b/tests/test_model/schema_validation/test_metadata.py index 90c701e..06a8729 100755 --- a/tests/test_model/schema_validation/test_metadata.py +++ b/tests/test_model/schema_validation/test_metadata.py @@ -3,7 +3,7 @@ import pytest -from playground_plums.model.exception import PlumsModelMetadataValidationError +from plums.model.exception import PlumsModelMetadataValidationError @contextmanager @@ -736,7 +736,7 @@ def metadata(format_low_param, model): def test_metadata(metadata): - from playground_plums.model.validation.metadata import Metadata as Schema + from plums.model.validation.metadata import Metadata as Schema schema = Schema(verbose=False) @@ -754,7 +754,7 @@ def test_metadata(metadata): def test_initialisation(initialisation): - from playground_plums.model.validation.metadata import Initialisation as Schema + from plums.model.validation.metadata import Initialisation as Schema schema = Schema(verbose=False) @@ -772,7 +772,7 @@ def test_initialisation(initialisation): def test_training(training): - from playground_plums.model.validation.metadata import Training as Schema + from plums.model.validation.metadata import Training as Schema schema = Schema(verbose=False) @@ -790,7 +790,7 @@ def test_training(training): def test_format(format): - from playground_plums.model.validation.metadata import Format as Schema + from plums.model.validation.metadata import Format as Schema schema = Schema(verbose=False) diff --git a/tests/test_model/schema_validation/test_structure.py b/tests/test_model/schema_validation/test_structure.py index d9bbc90..ca6d6d6 100755 --- a/tests/test_model/schema_validation/test_structure.py +++ b/tests/test_model/schema_validation/test_structure.py @@ -3,10 +3,10 @@ import pytest from tests.test_model.conftest import __metadata__, __metadata_empty__ -from playground_plums.model.exception import PlumsModelTreeValidationError, PlumsValidationError -from playground_plums.commons.path import Path -from playground_plums.model.validation import validate -from playground_plums.model.validation.utils.dict_from_tree import make_dict_structure_from_tree +from plums.model.exception import PlumsModelTreeValidationError, PlumsValidationError +from plums.commons.path import Path +from plums.model.validation import validate +from plums.model.validation.utils.dict_from_tree import make_dict_structure_from_tree @pytest.fixture() diff --git a/tests/test_model/test_components.py b/tests/test_model/test_components.py index 1f2bf7b..1058254 100755 --- a/tests/test_model/test_components.py +++ b/tests/test_model/test_components.py @@ -2,12 +2,12 @@ import pytest -from playground_plums.model.exception import PlumsValidationError +from plums.model.exception import PlumsValidationError -from playground_plums.commons.path import Path -from playground_plums.model.components.utils import Checkpoint, TrainingStatus -from playground_plums.model.components.version import Version, version, __version_register__, __version_hook_register__, register -from playground_plums.model.components.components import Producer, CheckpointCollection, Training +from plums.commons.path import Path +from plums.model.components.utils import Checkpoint, TrainingStatus +from plums.model.components.version import Version, version, __version_register__, __version_hook_register__, register +from plums.model.components.components import Producer, CheckpointCollection, Training class TestUtils: @@ -219,7 +219,7 @@ def __str__(self): assert not version_instance != 0 def test_py_pa(self): - from playground_plums.model.components.version import version + from plums.model.components.version import version version_instance = version('py_pa', '2.0.0') assert str(version_instance) == '2.0.0' diff --git a/tests/test_model/test_exceptions.py b/tests/test_model/test_exceptions.py index b5568a6..d9096be 100755 --- a/tests/test_model/test_exceptions.py +++ b/tests/test_model/test_exceptions.py @@ -2,7 +2,7 @@ from schema import SchemaError, SchemaForbiddenKeyError, SchemaMissingKeyError, \ SchemaOnlyOneAllowedError, SchemaUnexpectedTypeError, SchemaWrongKeyError -from playground_plums.model.exception import PlumsError, PlumsValidationError, PlumsModelError, \ +from plums.model.exception import PlumsError, PlumsValidationError, PlumsModelError, \ PlumsModelMetadataValidationError, PlumsModelTreeValidationError diff --git a/tests/test_model/test_model.py b/tests/test_model/test_model.py index 2114f91..77658a2 100755 --- a/tests/test_model/test_model.py +++ b/tests/test_model/test_model.py @@ -3,10 +3,10 @@ import pytest -from playground_plums.commons.path import Path -from playground_plums.model import Producer, CheckpointCollection, Training -from playground_plums.model.components.utils import is_duplicate, copy, rmtree, Checkpoint, md5_checksum -from playground_plums.model.model import Model, initialisation +from plums.commons.path import Path +from plums.model import Producer, CheckpointCollection, Training +from plums.model.components.utils import is_duplicate, copy, rmtree, Checkpoint, md5_checksum +from plums.model.model import Model, initialisation __char_index = -1 diff --git a/tests/test_plot/color/test_color.py b/tests/test_plot/color/test_color.py index ec30908..ead9d86 100755 --- a/tests/test_plot/color/test_color.py +++ b/tests/test_plot/color/test_color.py @@ -1,7 +1,7 @@ import pytest import numpy as np -from playground_plums.plot.engine.color.color import Color +from plums.plot.engine.color.color import Color tol = 1e-3 diff --git a/tests/test_plot/color/test_color_map.py b/tests/test_plot/color/test_color_map.py index 4c4a50e..3fa7870 100755 --- a/tests/test_plot/color/test_color_map.py +++ b/tests/test_plot/color/test_color_map.py @@ -1,7 +1,7 @@ import pytest import numpy as np -from playground_plums.plot.engine.color import ContinuousColorMap, DiscreteColorMap, KeyPointsColorMap, \ +from plums.plot.engine.color import ContinuousColorMap, DiscreteColorMap, KeyPointsColorMap, \ CircularColorMap, LightnessColorMap, Color, SemiCircularColorMap diff --git a/tests/test_plot/test_categorical_record_collection.py b/tests/test_plot/test_categorical_record_collection.py index 62f5dda..ba05a58 100755 --- a/tests/test_plot/test_categorical_record_collection.py +++ b/tests/test_plot/test_categorical_record_collection.py @@ -1,5 +1,5 @@ -from playground_plums.commons import RecordCollection, Record -from playground_plums.plot.engine.color_engine import CategoricalRecordCollection +from plums.commons import RecordCollection, Record +from plums.plot.engine.color_engine import CategoricalRecordCollection class TestRecord: diff --git a/tests/test_plot/test_compositor.py b/tests/test_plot/test_compositor.py index e9da992..f806b6d 100755 --- a/tests/test_plot/test_compositor.py +++ b/tests/test_plot/test_compositor.py @@ -1,9 +1,9 @@ import numpy as np import pytest -from playground_plums.commons import TileWrapper, DataPoint, RecordCollection, Record, Annotation -from playground_plums.plot.engine.color import Color -from playground_plums.plot.engine.compositor import Compositor +from plums.commons import TileWrapper, DataPoint, RecordCollection, Record, Annotation +from plums.plot.engine.color import Color +from plums.plot.engine.compositor import Compositor class TestCompositor: diff --git a/tests/test_plot/test_descriptors.py b/tests/test_plot/test_descriptors.py index d5856f6..1dd3552 100755 --- a/tests/test_plot/test_descriptors.py +++ b/tests/test_plot/test_descriptors.py @@ -6,13 +6,13 @@ import numpy as np from schema import SchemaError -from playground_plums.plot.engine.color import Color, CategoricalColorMap -from playground_plums.commons import RecordCollection, Record -from playground_plums.plot.engine.descriptor import ( +from plums.plot.engine.color import Color, CategoricalColorMap +from plums.commons import RecordCollection, Record +from plums.plot.engine.descriptor import ( CategoricalDescriptor, ContinuousDescriptor, IntervalDescriptor, Descriptor, Labels, Confidence, Area, IntervalArea, IntervalConfidence, _area ) -from playground_plums.plot.engine.color_engine import ColorEngine, ByCategoryDescriptor +from plums.plot.engine.color_engine import ColorEngine, ByCategoryDescriptor class Type(object): diff --git a/tests/test_plot/test_legend_painter.py b/tests/test_plot/test_legend_painter.py index 6b4c293..32127cc 100755 --- a/tests/test_plot/test_legend_painter.py +++ b/tests/test_plot/test_legend_painter.py @@ -1,8 +1,8 @@ import numpy as np import PIL.Image -from playground_plums.plot.engine.legend_painter import LegendPainter, LegendItemDrawer -from playground_plums.plot.engine.color import Color, LightnessColorMap +from plums.plot.engine.legend_painter import LegendPainter, LegendItemDrawer +from plums.plot.engine.color import Color, LightnessColorMap class TestLegendItemDrawer: diff --git a/tests/test_plot/test_orchestrator.py b/tests/test_plot/test_orchestrator.py index ae38eee..376c2ec 100755 --- a/tests/test_plot/test_orchestrator.py +++ b/tests/test_plot/test_orchestrator.py @@ -2,11 +2,11 @@ import numpy as np import PIL.Image -from playground_plums.commons.data import TileWrapper, RecordCollection, Record -from playground_plums.plot.engine.descriptor import ( +from plums.commons.data import TileWrapper, RecordCollection, Record +from plums.plot.engine.descriptor import ( CategoricalDescriptor, ContinuousDescriptor, IntervalDescriptor, Labels ) -from playground_plums.plot.engine.orchestrator import Orchestrator +from plums.plot.engine.orchestrator import Orchestrator __options__ = ('zoom', 'plot_centers', 'plot_confidences', 'title', 'background_color', 'fill', diff --git a/tests/test_plot/test_painter.py b/tests/test_plot/test_painter.py index 5264741..de716e2 100755 --- a/tests/test_plot/test_painter.py +++ b/tests/test_plot/test_painter.py @@ -5,10 +5,10 @@ import numpy as np -from playground_plums.commons import TileWrapper, DataPoint, RecordCollection, Record, Annotation, Label -from playground_plums.plot.engine.painter import Geometry, Draw, TagPainter, Position, Painter -from playground_plums.plot.engine.descriptor import Confidence -from playground_plums.plot.engine.color import Color +from plums.commons import TileWrapper, DataPoint, RecordCollection, Record, Annotation, Label +from plums.plot.engine.painter import Geometry, Draw, TagPainter, Position, Painter +from plums.plot.engine.descriptor import Confidence +from plums.plot.engine.color import Color class TestGeometry: diff --git a/tests/test_plot/test_plot.py b/tests/test_plot/test_plot.py index f9d82a3..6b1cf27 100755 --- a/tests/test_plot/test_plot.py +++ b/tests/test_plot/test_plot.py @@ -4,9 +4,9 @@ import PIL.Image import pytest -from playground_plums.commons import TileWrapper, RecordCollection, Record, Path -from playground_plums.plot.engine.descriptor import CategoricalDescriptor, Labels -from playground_plums.plot.plot import StandardPlot, PairPlot +from plums.commons import TileWrapper, RecordCollection, Record, Path +from plums.plot.engine.descriptor import CategoricalDescriptor, Labels +from plums.plot.plot import StandardPlot, PairPlot __options__ = ('zoom', 'plot_centers', 'plot_confidences', 'title', 'background_color', 'fill', diff --git a/tests/test_plot/test_position_generator.py b/tests/test_plot/test_position_generator.py index 1fe6736..673c7be 100755 --- a/tests/test_plot/test_position_generator.py +++ b/tests/test_plot/test_position_generator.py @@ -1,6 +1,6 @@ import pytest -from playground_plums.plot.engine.position_generator import ( +from plums.plot.engine.position_generator import ( SimpleImagePositionGenerator, LayoutImagePositionGenerator, AdaptiveImagePositionGenerator, diff --git a/tests/test_plot/test_utils.py b/tests/test_plot/test_utils.py index 01cddcc..732a75d 100755 --- a/tests/test_plot/test_utils.py +++ b/tests/test_plot/test_utils.py @@ -1,6 +1,6 @@ import pytest -from playground_plums.plot.engine.utils import get_default_font, get_text_color +from plums.plot.engine.utils import get_default_font, get_text_color def test_get_text_color():