From 6d3870199809e8cc344df4a1638b88bdbec65fc7 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Wed, 2 Jun 2021 15:33:35 -0500 Subject: [PATCH 01/24] etsdemo boilerplate --- chaco/__init__.py | 4 +++ chaco/examples/__init__.py | 0 chaco/examples/_etsdemo_info.py | 34 +++++++++++++++++++++++ chaco/examples/tests/__init__.py | 0 chaco/examples/tests/test_etsdemo_info.py | 21 ++++++++++++++ setup.py | 8 ++++++ 6 files changed, 67 insertions(+) create mode 100644 chaco/examples/__init__.py create mode 100644 chaco/examples/_etsdemo_info.py create mode 100644 chaco/examples/tests/__init__.py create mode 100644 chaco/examples/tests/test_etsdemo_info.py diff --git a/chaco/__init__.py b/chaco/__init__.py index 45df0b907..21b2908e1 100644 --- a/chaco/__init__.py +++ b/chaco/__init__.py @@ -9,3 +9,7 @@ __version__ = "not-built" __requires__ = ["traits", "traitsui", "pyface", "numpy", "enable"] + +__extras_require__ = { + 'examples': ['scipy', 'mayavi'] +} diff --git a/chaco/examples/__init__.py b/chaco/examples/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/chaco/examples/_etsdemo_info.py b/chaco/examples/_etsdemo_info.py new file mode 100644 index 000000000..e084da826 --- /dev/null +++ b/chaco/examples/_etsdemo_info.py @@ -0,0 +1,34 @@ +# (C) Copyright 2005-2021 Enthought, Inc., Austin, TX +# All rights reserved. +# +# This software is provided without warranty under the terms of the BSD +# license included in LICENSE.txt and may be redistributed only under +# the conditions described in the aforementioned license. The license +# is also available online at http://www.enthought.com/licenses/BSD.txt +# +# Thanks for using Enthought open source! + +""" This module provides functions to be advertised in the distribution +entry points. +""" + +import pkg_resources + + +def info(request): + """ Return a configuration for contributing examples to the + Demo application. + Parameters + ---------- + request : dict + Information provided by the demo application. + Currently this is a placeholder. + Returns + ------- + response : dict + """ + return { + "version": 1, + "name": "Chaco Examples", + "root": pkg_resources.resource_filename("chaco.examples", "demo"), + } diff --git a/chaco/examples/tests/__init__.py b/chaco/examples/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/chaco/examples/tests/test_etsdemo_info.py b/chaco/examples/tests/test_etsdemo_info.py new file mode 100644 index 000000000..ba0b40fbd --- /dev/null +++ b/chaco/examples/tests/test_etsdemo_info.py @@ -0,0 +1,21 @@ +# (C) Copyright 2011-2020 Enthought, Inc., Austin, TX +# All rights reserved. +# +# This software is provided without warranty under the terms of the BSD +# license included in LICENSE.txt and may be redistributed only under +# the conditions described in the aforementioned license. The license +# is also available online at http://www.enthought.com/licenses/BSD.txt +# +# Thanks for using Enthought open source! +import os +import unittest + +from chaco.examples._etsdemo_info import info + + +class TestChacoETSDemoInfo(unittest.TestCase): + + def test_info(self): + # input to info is currently just a placeholder + response = info({}) + self.assertTrue(os.path.exists(response['root'])) diff --git a/setup.py b/setup.py index 0e54adbac..69019fd70 100644 --- a/setup.py +++ b/setup.py @@ -280,6 +280,7 @@ def resolve_version(): __version__, _ = resolve_version() data = read_module('__init__') __requires__ = data['__requires__'] + __extras_require__ = data['__extras_require__'] numpy_include_dir = get_include() @@ -331,6 +332,12 @@ def resolve_version(): Topic :: Software Development Topic :: Software Development :: Libraries """.splitlines() if len(c.strip()) > 0], + entry_points={ + "etsdemo_data": [ + "chaco_examples = chaco.examples._etsdemo_info:info", + 'chaco.examples': ['demo/*', 'demo/*/*'], + ] + }, package_data={ 'chaco': [ 'overlays/layers/data/*.svg', @@ -343,6 +350,7 @@ def resolve_version(): ext_modules=extensions, include_package_data=True, install_requires=__requires__, + extras_require=__extras_require__, license='BSD', packages=find_packages(), platforms=["Windows", "Linux", "Mac OS-X", "Unix", "Solaris"], From 37f3fba4bf9b5f746a36ff11ed38ffdbf9761dd9 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Wed, 2 Jun 2021 15:33:58 -0500 Subject: [PATCH 02/24] delete demo.py --- examples/demo/demo.py | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 examples/demo/demo.py diff --git a/examples/demo/demo.py b/examples/demo/demo.py deleted file mode 100644 index 2ecf5b7c4..000000000 --- a/examples/demo/demo.py +++ /dev/null @@ -1,23 +0,0 @@ -# ------------------------------------------------------------------------------- -# -# Copyright (c) 2009-2010, Enthought, Inc. -# All rights reserved. -# -# This software is provided without warranty under the terms of the BSD -# license included in enthought/LICENSE.txt and may be redistributed only -# under the conditions described in the aforementioned license. The license -# is also available online at http://www.enthought.com/licenses/BSD.txt -# -# Thanks for using Enthought open source! -# -# Author: Vibha Srinivasan -# Date: 02/03/2009 -# -# ------------------------------------------------------------------------------- - -""" Run the Chaco demo. -""" - -from traitsui.extras.demo import demo - -demo(use_files=True, title="Chaco Demos") From 1ddbd95be09b906b8d591e19ef0ab00caa779a48 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Wed, 2 Jun 2021 15:49:15 -0500 Subject: [PATCH 03/24] move examples/demo/basic into chaco/examples --- .../demo/basic => chaco/examples/demo}/__init__.py | 0 chaco/examples/demo/basic/__init__.py | 0 .../examples}/demo/basic/bar_plot_configurable.py | 0 .../examples}/demo/basic/bar_plot_stacked.py | 0 .../examples}/demo/basic/bounded_grids.py | 0 {examples => chaco/examples}/demo/basic/candle.py | 0 {examples => chaco/examples}/demo/basic/capitol.jpg | Bin {examples => chaco/examples}/demo/basic/cat.jpg | Bin .../examples}/demo/basic/cmap_image_aspect_ratio.py | 0 .../examples}/demo/basic/cmap_image_plot.py | 0 .../examples}/demo/basic/cmap_image_select.py | 0 .../examples}/demo/basic/cmap_scatter.py | 0 .../examples}/demo/basic/cmap_segment_plot.py | 0 .../examples}/demo/basic/contour_cmap_plot.py | 0 .../examples}/demo/basic/contour_plot.py | 0 .../demo/basic/discrete_cmap_image_plot.py | 0 .../examples}/demo/basic/discrete_cmap_scatter.py | 0 .../examples}/demo/basic/draw_layers.py | 0 .../examples}/demo/basic/grid_container.py | 0 .../demo/basic/grid_container_aspect_ratio.py | 0 .../examples}/demo/basic/hittest_tool.py | 0 .../examples}/demo/basic/horizon_plot.py | 0 .../examples}/demo/basic/image_LICENSE.txt | 0 .../examples}/demo/basic/image_from_file.py | 0 .../examples}/demo/basic/image_inspector.py | 0 .../examples}/demo/basic/image_lasso.py | 0 .../examples}/demo/basic/image_plot.py | 0 .../examples}/demo/basic/inset_plot.py | 0 .../examples}/demo/basic/line_drawing.py | 0 .../examples}/demo/basic/line_plot1.py | 0 .../examples}/demo/basic/line_plot_hold.py | 0 {examples => chaco/examples}/demo/basic/log_plot.py | 0 .../examples}/demo/basic/minard_napoleon.py | 0 .../examples}/demo/basic/minor_ticks_axis.py | 0 .../examples}/demo/basic/nans_plot.py | 0 .../examples}/demo/basic/pandas_data.py | 0 .../examples}/demo/basic/polygon_move.py | 0 .../examples}/demo/basic/polygon_plot_demo.py | 0 .../examples}/demo/basic/regression.py | 0 {examples => chaco/examples}/demo/basic/scatter.py | 0 .../examples}/demo/basic/scatter_1d.py | 0 .../examples}/demo/basic/scatter_alpha.py | 0 .../examples}/demo/basic/scatter_custom_marker.py | 0 .../examples}/demo/basic/scatter_inspector.py | 0 .../examples}/demo/basic/scatter_inspector2.py | 0 .../examples}/demo/basic/scatter_rect_select.py | 0 .../examples}/demo/basic/scatter_select.py | 0 .../examples}/demo/basic/scatter_toggle.py | 0 .../examples}/demo/basic/scatter_variable_size.py | 0 .../examples}/demo/basic/scrollbar.py | 0 .../examples}/demo/basic/segment_plot.py | 0 .../examples}/demo/basic/tabbed_plots.py | 0 .../examples}/demo/basic/zoomable_colorbar.py | 0 53 files changed, 0 insertions(+), 0 deletions(-) rename {examples/demo/basic => chaco/examples/demo}/__init__.py (100%) create mode 100644 chaco/examples/demo/basic/__init__.py rename {examples => chaco/examples}/demo/basic/bar_plot_configurable.py (100%) rename {examples => chaco/examples}/demo/basic/bar_plot_stacked.py (100%) rename {examples => chaco/examples}/demo/basic/bounded_grids.py (100%) rename {examples => chaco/examples}/demo/basic/candle.py (100%) rename {examples => chaco/examples}/demo/basic/capitol.jpg (100%) rename {examples => chaco/examples}/demo/basic/cat.jpg (100%) rename {examples => chaco/examples}/demo/basic/cmap_image_aspect_ratio.py (100%) rename {examples => chaco/examples}/demo/basic/cmap_image_plot.py (100%) rename {examples => chaco/examples}/demo/basic/cmap_image_select.py (100%) rename {examples => chaco/examples}/demo/basic/cmap_scatter.py (100%) rename {examples => chaco/examples}/demo/basic/cmap_segment_plot.py (100%) rename {examples => chaco/examples}/demo/basic/contour_cmap_plot.py (100%) rename {examples => chaco/examples}/demo/basic/contour_plot.py (100%) rename {examples => chaco/examples}/demo/basic/discrete_cmap_image_plot.py (100%) rename {examples => chaco/examples}/demo/basic/discrete_cmap_scatter.py (100%) rename {examples => chaco/examples}/demo/basic/draw_layers.py (100%) rename {examples => chaco/examples}/demo/basic/grid_container.py (100%) rename {examples => chaco/examples}/demo/basic/grid_container_aspect_ratio.py (100%) rename {examples => chaco/examples}/demo/basic/hittest_tool.py (100%) rename {examples => chaco/examples}/demo/basic/horizon_plot.py (100%) rename {examples => chaco/examples}/demo/basic/image_LICENSE.txt (100%) rename {examples => chaco/examples}/demo/basic/image_from_file.py (100%) rename {examples => chaco/examples}/demo/basic/image_inspector.py (100%) rename {examples => chaco/examples}/demo/basic/image_lasso.py (100%) rename {examples => chaco/examples}/demo/basic/image_plot.py (100%) rename {examples => chaco/examples}/demo/basic/inset_plot.py (100%) rename {examples => chaco/examples}/demo/basic/line_drawing.py (100%) rename {examples => chaco/examples}/demo/basic/line_plot1.py (100%) rename {examples => chaco/examples}/demo/basic/line_plot_hold.py (100%) rename {examples => chaco/examples}/demo/basic/log_plot.py (100%) rename {examples => chaco/examples}/demo/basic/minard_napoleon.py (100%) rename {examples => chaco/examples}/demo/basic/minor_ticks_axis.py (100%) rename {examples => chaco/examples}/demo/basic/nans_plot.py (100%) rename {examples => chaco/examples}/demo/basic/pandas_data.py (100%) rename {examples => chaco/examples}/demo/basic/polygon_move.py (100%) rename {examples => chaco/examples}/demo/basic/polygon_plot_demo.py (100%) rename {examples => chaco/examples}/demo/basic/regression.py (100%) rename {examples => chaco/examples}/demo/basic/scatter.py (100%) rename {examples => chaco/examples}/demo/basic/scatter_1d.py (100%) rename {examples => chaco/examples}/demo/basic/scatter_alpha.py (100%) rename {examples => chaco/examples}/demo/basic/scatter_custom_marker.py (100%) rename {examples => chaco/examples}/demo/basic/scatter_inspector.py (100%) rename {examples => chaco/examples}/demo/basic/scatter_inspector2.py (100%) rename {examples => chaco/examples}/demo/basic/scatter_rect_select.py (100%) rename {examples => chaco/examples}/demo/basic/scatter_select.py (100%) rename {examples => chaco/examples}/demo/basic/scatter_toggle.py (100%) rename {examples => chaco/examples}/demo/basic/scatter_variable_size.py (100%) rename {examples => chaco/examples}/demo/basic/scrollbar.py (100%) rename {examples => chaco/examples}/demo/basic/segment_plot.py (100%) rename {examples => chaco/examples}/demo/basic/tabbed_plots.py (100%) rename {examples => chaco/examples}/demo/basic/zoomable_colorbar.py (100%) diff --git a/examples/demo/basic/__init__.py b/chaco/examples/demo/__init__.py similarity index 100% rename from examples/demo/basic/__init__.py rename to chaco/examples/demo/__init__.py diff --git a/chaco/examples/demo/basic/__init__.py b/chaco/examples/demo/basic/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/examples/demo/basic/bar_plot_configurable.py b/chaco/examples/demo/basic/bar_plot_configurable.py similarity index 100% rename from examples/demo/basic/bar_plot_configurable.py rename to chaco/examples/demo/basic/bar_plot_configurable.py diff --git a/examples/demo/basic/bar_plot_stacked.py b/chaco/examples/demo/basic/bar_plot_stacked.py similarity index 100% rename from examples/demo/basic/bar_plot_stacked.py rename to chaco/examples/demo/basic/bar_plot_stacked.py diff --git a/examples/demo/basic/bounded_grids.py b/chaco/examples/demo/basic/bounded_grids.py similarity index 100% rename from examples/demo/basic/bounded_grids.py rename to chaco/examples/demo/basic/bounded_grids.py diff --git a/examples/demo/basic/candle.py b/chaco/examples/demo/basic/candle.py similarity index 100% rename from examples/demo/basic/candle.py rename to chaco/examples/demo/basic/candle.py diff --git a/examples/demo/basic/capitol.jpg b/chaco/examples/demo/basic/capitol.jpg similarity index 100% rename from examples/demo/basic/capitol.jpg rename to chaco/examples/demo/basic/capitol.jpg diff --git a/examples/demo/basic/cat.jpg b/chaco/examples/demo/basic/cat.jpg similarity index 100% rename from examples/demo/basic/cat.jpg rename to chaco/examples/demo/basic/cat.jpg diff --git a/examples/demo/basic/cmap_image_aspect_ratio.py b/chaco/examples/demo/basic/cmap_image_aspect_ratio.py similarity index 100% rename from examples/demo/basic/cmap_image_aspect_ratio.py rename to chaco/examples/demo/basic/cmap_image_aspect_ratio.py diff --git a/examples/demo/basic/cmap_image_plot.py b/chaco/examples/demo/basic/cmap_image_plot.py similarity index 100% rename from examples/demo/basic/cmap_image_plot.py rename to chaco/examples/demo/basic/cmap_image_plot.py diff --git a/examples/demo/basic/cmap_image_select.py b/chaco/examples/demo/basic/cmap_image_select.py similarity index 100% rename from examples/demo/basic/cmap_image_select.py rename to chaco/examples/demo/basic/cmap_image_select.py diff --git a/examples/demo/basic/cmap_scatter.py b/chaco/examples/demo/basic/cmap_scatter.py similarity index 100% rename from examples/demo/basic/cmap_scatter.py rename to chaco/examples/demo/basic/cmap_scatter.py diff --git a/examples/demo/basic/cmap_segment_plot.py b/chaco/examples/demo/basic/cmap_segment_plot.py similarity index 100% rename from examples/demo/basic/cmap_segment_plot.py rename to chaco/examples/demo/basic/cmap_segment_plot.py diff --git a/examples/demo/basic/contour_cmap_plot.py b/chaco/examples/demo/basic/contour_cmap_plot.py similarity index 100% rename from examples/demo/basic/contour_cmap_plot.py rename to chaco/examples/demo/basic/contour_cmap_plot.py diff --git a/examples/demo/basic/contour_plot.py b/chaco/examples/demo/basic/contour_plot.py similarity index 100% rename from examples/demo/basic/contour_plot.py rename to chaco/examples/demo/basic/contour_plot.py diff --git a/examples/demo/basic/discrete_cmap_image_plot.py b/chaco/examples/demo/basic/discrete_cmap_image_plot.py similarity index 100% rename from examples/demo/basic/discrete_cmap_image_plot.py rename to chaco/examples/demo/basic/discrete_cmap_image_plot.py diff --git a/examples/demo/basic/discrete_cmap_scatter.py b/chaco/examples/demo/basic/discrete_cmap_scatter.py similarity index 100% rename from examples/demo/basic/discrete_cmap_scatter.py rename to chaco/examples/demo/basic/discrete_cmap_scatter.py diff --git a/examples/demo/basic/draw_layers.py b/chaco/examples/demo/basic/draw_layers.py similarity index 100% rename from examples/demo/basic/draw_layers.py rename to chaco/examples/demo/basic/draw_layers.py diff --git a/examples/demo/basic/grid_container.py b/chaco/examples/demo/basic/grid_container.py similarity index 100% rename from examples/demo/basic/grid_container.py rename to chaco/examples/demo/basic/grid_container.py diff --git a/examples/demo/basic/grid_container_aspect_ratio.py b/chaco/examples/demo/basic/grid_container_aspect_ratio.py similarity index 100% rename from examples/demo/basic/grid_container_aspect_ratio.py rename to chaco/examples/demo/basic/grid_container_aspect_ratio.py diff --git a/examples/demo/basic/hittest_tool.py b/chaco/examples/demo/basic/hittest_tool.py similarity index 100% rename from examples/demo/basic/hittest_tool.py rename to chaco/examples/demo/basic/hittest_tool.py diff --git a/examples/demo/basic/horizon_plot.py b/chaco/examples/demo/basic/horizon_plot.py similarity index 100% rename from examples/demo/basic/horizon_plot.py rename to chaco/examples/demo/basic/horizon_plot.py diff --git a/examples/demo/basic/image_LICENSE.txt b/chaco/examples/demo/basic/image_LICENSE.txt similarity index 100% rename from examples/demo/basic/image_LICENSE.txt rename to chaco/examples/demo/basic/image_LICENSE.txt diff --git a/examples/demo/basic/image_from_file.py b/chaco/examples/demo/basic/image_from_file.py similarity index 100% rename from examples/demo/basic/image_from_file.py rename to chaco/examples/demo/basic/image_from_file.py diff --git a/examples/demo/basic/image_inspector.py b/chaco/examples/demo/basic/image_inspector.py similarity index 100% rename from examples/demo/basic/image_inspector.py rename to chaco/examples/demo/basic/image_inspector.py diff --git a/examples/demo/basic/image_lasso.py b/chaco/examples/demo/basic/image_lasso.py similarity index 100% rename from examples/demo/basic/image_lasso.py rename to chaco/examples/demo/basic/image_lasso.py diff --git a/examples/demo/basic/image_plot.py b/chaco/examples/demo/basic/image_plot.py similarity index 100% rename from examples/demo/basic/image_plot.py rename to chaco/examples/demo/basic/image_plot.py diff --git a/examples/demo/basic/inset_plot.py b/chaco/examples/demo/basic/inset_plot.py similarity index 100% rename from examples/demo/basic/inset_plot.py rename to chaco/examples/demo/basic/inset_plot.py diff --git a/examples/demo/basic/line_drawing.py b/chaco/examples/demo/basic/line_drawing.py similarity index 100% rename from examples/demo/basic/line_drawing.py rename to chaco/examples/demo/basic/line_drawing.py diff --git a/examples/demo/basic/line_plot1.py b/chaco/examples/demo/basic/line_plot1.py similarity index 100% rename from examples/demo/basic/line_plot1.py rename to chaco/examples/demo/basic/line_plot1.py diff --git a/examples/demo/basic/line_plot_hold.py b/chaco/examples/demo/basic/line_plot_hold.py similarity index 100% rename from examples/demo/basic/line_plot_hold.py rename to chaco/examples/demo/basic/line_plot_hold.py diff --git a/examples/demo/basic/log_plot.py b/chaco/examples/demo/basic/log_plot.py similarity index 100% rename from examples/demo/basic/log_plot.py rename to chaco/examples/demo/basic/log_plot.py diff --git a/examples/demo/basic/minard_napoleon.py b/chaco/examples/demo/basic/minard_napoleon.py similarity index 100% rename from examples/demo/basic/minard_napoleon.py rename to chaco/examples/demo/basic/minard_napoleon.py diff --git a/examples/demo/basic/minor_ticks_axis.py b/chaco/examples/demo/basic/minor_ticks_axis.py similarity index 100% rename from examples/demo/basic/minor_ticks_axis.py rename to chaco/examples/demo/basic/minor_ticks_axis.py diff --git a/examples/demo/basic/nans_plot.py b/chaco/examples/demo/basic/nans_plot.py similarity index 100% rename from examples/demo/basic/nans_plot.py rename to chaco/examples/demo/basic/nans_plot.py diff --git a/examples/demo/basic/pandas_data.py b/chaco/examples/demo/basic/pandas_data.py similarity index 100% rename from examples/demo/basic/pandas_data.py rename to chaco/examples/demo/basic/pandas_data.py diff --git a/examples/demo/basic/polygon_move.py b/chaco/examples/demo/basic/polygon_move.py similarity index 100% rename from examples/demo/basic/polygon_move.py rename to chaco/examples/demo/basic/polygon_move.py diff --git a/examples/demo/basic/polygon_plot_demo.py b/chaco/examples/demo/basic/polygon_plot_demo.py similarity index 100% rename from examples/demo/basic/polygon_plot_demo.py rename to chaco/examples/demo/basic/polygon_plot_demo.py diff --git a/examples/demo/basic/regression.py b/chaco/examples/demo/basic/regression.py similarity index 100% rename from examples/demo/basic/regression.py rename to chaco/examples/demo/basic/regression.py diff --git a/examples/demo/basic/scatter.py b/chaco/examples/demo/basic/scatter.py similarity index 100% rename from examples/demo/basic/scatter.py rename to chaco/examples/demo/basic/scatter.py diff --git a/examples/demo/basic/scatter_1d.py b/chaco/examples/demo/basic/scatter_1d.py similarity index 100% rename from examples/demo/basic/scatter_1d.py rename to chaco/examples/demo/basic/scatter_1d.py diff --git a/examples/demo/basic/scatter_alpha.py b/chaco/examples/demo/basic/scatter_alpha.py similarity index 100% rename from examples/demo/basic/scatter_alpha.py rename to chaco/examples/demo/basic/scatter_alpha.py diff --git a/examples/demo/basic/scatter_custom_marker.py b/chaco/examples/demo/basic/scatter_custom_marker.py similarity index 100% rename from examples/demo/basic/scatter_custom_marker.py rename to chaco/examples/demo/basic/scatter_custom_marker.py diff --git a/examples/demo/basic/scatter_inspector.py b/chaco/examples/demo/basic/scatter_inspector.py similarity index 100% rename from examples/demo/basic/scatter_inspector.py rename to chaco/examples/demo/basic/scatter_inspector.py diff --git a/examples/demo/basic/scatter_inspector2.py b/chaco/examples/demo/basic/scatter_inspector2.py similarity index 100% rename from examples/demo/basic/scatter_inspector2.py rename to chaco/examples/demo/basic/scatter_inspector2.py diff --git a/examples/demo/basic/scatter_rect_select.py b/chaco/examples/demo/basic/scatter_rect_select.py similarity index 100% rename from examples/demo/basic/scatter_rect_select.py rename to chaco/examples/demo/basic/scatter_rect_select.py diff --git a/examples/demo/basic/scatter_select.py b/chaco/examples/demo/basic/scatter_select.py similarity index 100% rename from examples/demo/basic/scatter_select.py rename to chaco/examples/demo/basic/scatter_select.py diff --git a/examples/demo/basic/scatter_toggle.py b/chaco/examples/demo/basic/scatter_toggle.py similarity index 100% rename from examples/demo/basic/scatter_toggle.py rename to chaco/examples/demo/basic/scatter_toggle.py diff --git a/examples/demo/basic/scatter_variable_size.py b/chaco/examples/demo/basic/scatter_variable_size.py similarity index 100% rename from examples/demo/basic/scatter_variable_size.py rename to chaco/examples/demo/basic/scatter_variable_size.py diff --git a/examples/demo/basic/scrollbar.py b/chaco/examples/demo/basic/scrollbar.py similarity index 100% rename from examples/demo/basic/scrollbar.py rename to chaco/examples/demo/basic/scrollbar.py diff --git a/examples/demo/basic/segment_plot.py b/chaco/examples/demo/basic/segment_plot.py similarity index 100% rename from examples/demo/basic/segment_plot.py rename to chaco/examples/demo/basic/segment_plot.py diff --git a/examples/demo/basic/tabbed_plots.py b/chaco/examples/demo/basic/tabbed_plots.py similarity index 100% rename from examples/demo/basic/tabbed_plots.py rename to chaco/examples/demo/basic/tabbed_plots.py diff --git a/examples/demo/basic/zoomable_colorbar.py b/chaco/examples/demo/basic/zoomable_colorbar.py similarity index 100% rename from examples/demo/basic/zoomable_colorbar.py rename to chaco/examples/demo/basic/zoomable_colorbar.py From b4c57572e62973a0cbb4b6904df4c643ede18bcc Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Wed, 2 Jun 2021 16:05:11 -0500 Subject: [PATCH 04/24] move select examples from examples/demo/advanced into chaco/examples --- chaco/examples/demo/advanced/__init__.py | 0 .../examples}/demo/advanced/cmap_variable_sized_scatter.py | 0 {examples => chaco/examples}/demo/advanced/data_cube.py | 0 {examples => chaco/examples}/demo/advanced/data_stream.py | 0 .../examples}/demo/advanced/scalar_image_function_inspector.py | 0 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 chaco/examples/demo/advanced/__init__.py rename {examples => chaco/examples}/demo/advanced/cmap_variable_sized_scatter.py (100%) rename {examples => chaco/examples}/demo/advanced/data_cube.py (100%) rename {examples => chaco/examples}/demo/advanced/data_stream.py (100%) rename {examples => chaco/examples}/demo/advanced/scalar_image_function_inspector.py (100%) diff --git a/chaco/examples/demo/advanced/__init__.py b/chaco/examples/demo/advanced/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/examples/demo/advanced/cmap_variable_sized_scatter.py b/chaco/examples/demo/advanced/cmap_variable_sized_scatter.py similarity index 100% rename from examples/demo/advanced/cmap_variable_sized_scatter.py rename to chaco/examples/demo/advanced/cmap_variable_sized_scatter.py diff --git a/examples/demo/advanced/data_cube.py b/chaco/examples/demo/advanced/data_cube.py similarity index 100% rename from examples/demo/advanced/data_cube.py rename to chaco/examples/demo/advanced/data_cube.py diff --git a/examples/demo/advanced/data_stream.py b/chaco/examples/demo/advanced/data_stream.py similarity index 100% rename from examples/demo/advanced/data_stream.py rename to chaco/examples/demo/advanced/data_stream.py diff --git a/examples/demo/advanced/scalar_image_function_inspector.py b/chaco/examples/demo/advanced/scalar_image_function_inspector.py similarity index 100% rename from examples/demo/advanced/scalar_image_function_inspector.py rename to chaco/examples/demo/advanced/scalar_image_function_inspector.py From d9f98dd008640bf13491a2d15835466203a7dee7 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Wed, 2 Jun 2021 16:07:48 -0500 Subject: [PATCH 05/24] move examples/demo/financial into chaco/examples --- {examples => chaco/examples}/demo/financial/__init__.py | 0 {examples => chaco/examples}/demo/financial/correlations.py | 0 {examples => chaco/examples}/demo/financial/stock_prices.py | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {examples => chaco/examples}/demo/financial/__init__.py (100%) rename {examples => chaco/examples}/demo/financial/correlations.py (100%) rename {examples => chaco/examples}/demo/financial/stock_prices.py (100%) diff --git a/examples/demo/financial/__init__.py b/chaco/examples/demo/financial/__init__.py similarity index 100% rename from examples/demo/financial/__init__.py rename to chaco/examples/demo/financial/__init__.py diff --git a/examples/demo/financial/correlations.py b/chaco/examples/demo/financial/correlations.py similarity index 100% rename from examples/demo/financial/correlations.py rename to chaco/examples/demo/financial/correlations.py diff --git a/examples/demo/financial/stock_prices.py b/chaco/examples/demo/financial/stock_prices.py similarity index 100% rename from examples/demo/financial/stock_prices.py rename to chaco/examples/demo/financial/stock_prices.py From e7f579c23f896a1058f07a0da8572dde4e28db4c Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Wed, 2 Jun 2021 16:30:30 -0500 Subject: [PATCH 06/24] move a bunch of selected examples from examples/demo into chaco/examples/demo --- {examples => chaco/examples}/demo/bigdata.py | 0 {examples => chaco/examples}/demo/coordinate_line_overlay_demo.py | 0 {examples => chaco/examples}/demo/cursor_tool_demo.py | 0 {examples => chaco/examples}/demo/data_labels.py | 0 {examples => chaco/examples}/demo/data_view.py | 0 {examples => chaco/examples}/demo/edit_line.py | 0 {examples => chaco/examples}/demo/functionplotter.py | 0 {examples => chaco/examples}/demo/hyetograph.py | 0 .../examples}/demo/image_plot_origin_and_orientation.py | 0 {examples => chaco/examples}/demo/multi_line_plot_demo.py | 0 {examples => chaco/examples}/demo/nonlinear_color_mapping.py | 0 {examples => chaco/examples}/demo/qt_example.py | 0 {examples => chaco/examples}/demo/quiver.py | 0 {examples => chaco/examples}/demo/range_selection_demo.py | 0 {examples => chaco/examples}/demo/scales_test.py | 0 {examples => chaco/examples}/demo/simple_line.py | 0 {examples => chaco/examples}/demo/simple_polar.py | 0 {examples => chaco/examples}/demo/stacked_axis.py | 0 {examples => chaco/examples}/demo/status_overlay.py | 0 {examples => chaco/examples}/demo/tornado.py | 0 {examples => chaco/examples}/demo/two_plots.py | 0 {examples => chaco/examples}/demo/vanderwaals.py | 0 {examples => chaco/examples}/demo/vertical_plot.py | 0 {examples => chaco/examples}/demo/xray_plot.py | 0 24 files changed, 0 insertions(+), 0 deletions(-) rename {examples => chaco/examples}/demo/bigdata.py (100%) rename {examples => chaco/examples}/demo/coordinate_line_overlay_demo.py (100%) rename {examples => chaco/examples}/demo/cursor_tool_demo.py (100%) rename {examples => chaco/examples}/demo/data_labels.py (100%) rename {examples => chaco/examples}/demo/data_view.py (100%) rename {examples => chaco/examples}/demo/edit_line.py (100%) rename {examples => chaco/examples}/demo/functionplotter.py (100%) rename {examples => chaco/examples}/demo/hyetograph.py (100%) rename {examples => chaco/examples}/demo/image_plot_origin_and_orientation.py (100%) rename {examples => chaco/examples}/demo/multi_line_plot_demo.py (100%) rename {examples => chaco/examples}/demo/nonlinear_color_mapping.py (100%) rename {examples => chaco/examples}/demo/qt_example.py (100%) rename {examples => chaco/examples}/demo/quiver.py (100%) rename {examples => chaco/examples}/demo/range_selection_demo.py (100%) rename {examples => chaco/examples}/demo/scales_test.py (100%) rename {examples => chaco/examples}/demo/simple_line.py (100%) rename {examples => chaco/examples}/demo/simple_polar.py (100%) rename {examples => chaco/examples}/demo/stacked_axis.py (100%) rename {examples => chaco/examples}/demo/status_overlay.py (100%) rename {examples => chaco/examples}/demo/tornado.py (100%) rename {examples => chaco/examples}/demo/two_plots.py (100%) rename {examples => chaco/examples}/demo/vanderwaals.py (100%) rename {examples => chaco/examples}/demo/vertical_plot.py (100%) rename {examples => chaco/examples}/demo/xray_plot.py (100%) diff --git a/examples/demo/bigdata.py b/chaco/examples/demo/bigdata.py similarity index 100% rename from examples/demo/bigdata.py rename to chaco/examples/demo/bigdata.py diff --git a/examples/demo/coordinate_line_overlay_demo.py b/chaco/examples/demo/coordinate_line_overlay_demo.py similarity index 100% rename from examples/demo/coordinate_line_overlay_demo.py rename to chaco/examples/demo/coordinate_line_overlay_demo.py diff --git a/examples/demo/cursor_tool_demo.py b/chaco/examples/demo/cursor_tool_demo.py similarity index 100% rename from examples/demo/cursor_tool_demo.py rename to chaco/examples/demo/cursor_tool_demo.py diff --git a/examples/demo/data_labels.py b/chaco/examples/demo/data_labels.py similarity index 100% rename from examples/demo/data_labels.py rename to chaco/examples/demo/data_labels.py diff --git a/examples/demo/data_view.py b/chaco/examples/demo/data_view.py similarity index 100% rename from examples/demo/data_view.py rename to chaco/examples/demo/data_view.py diff --git a/examples/demo/edit_line.py b/chaco/examples/demo/edit_line.py similarity index 100% rename from examples/demo/edit_line.py rename to chaco/examples/demo/edit_line.py diff --git a/examples/demo/functionplotter.py b/chaco/examples/demo/functionplotter.py similarity index 100% rename from examples/demo/functionplotter.py rename to chaco/examples/demo/functionplotter.py diff --git a/examples/demo/hyetograph.py b/chaco/examples/demo/hyetograph.py similarity index 100% rename from examples/demo/hyetograph.py rename to chaco/examples/demo/hyetograph.py diff --git a/examples/demo/image_plot_origin_and_orientation.py b/chaco/examples/demo/image_plot_origin_and_orientation.py similarity index 100% rename from examples/demo/image_plot_origin_and_orientation.py rename to chaco/examples/demo/image_plot_origin_and_orientation.py diff --git a/examples/demo/multi_line_plot_demo.py b/chaco/examples/demo/multi_line_plot_demo.py similarity index 100% rename from examples/demo/multi_line_plot_demo.py rename to chaco/examples/demo/multi_line_plot_demo.py diff --git a/examples/demo/nonlinear_color_mapping.py b/chaco/examples/demo/nonlinear_color_mapping.py similarity index 100% rename from examples/demo/nonlinear_color_mapping.py rename to chaco/examples/demo/nonlinear_color_mapping.py diff --git a/examples/demo/qt_example.py b/chaco/examples/demo/qt_example.py similarity index 100% rename from examples/demo/qt_example.py rename to chaco/examples/demo/qt_example.py diff --git a/examples/demo/quiver.py b/chaco/examples/demo/quiver.py similarity index 100% rename from examples/demo/quiver.py rename to chaco/examples/demo/quiver.py diff --git a/examples/demo/range_selection_demo.py b/chaco/examples/demo/range_selection_demo.py similarity index 100% rename from examples/demo/range_selection_demo.py rename to chaco/examples/demo/range_selection_demo.py diff --git a/examples/demo/scales_test.py b/chaco/examples/demo/scales_test.py similarity index 100% rename from examples/demo/scales_test.py rename to chaco/examples/demo/scales_test.py diff --git a/examples/demo/simple_line.py b/chaco/examples/demo/simple_line.py similarity index 100% rename from examples/demo/simple_line.py rename to chaco/examples/demo/simple_line.py diff --git a/examples/demo/simple_polar.py b/chaco/examples/demo/simple_polar.py similarity index 100% rename from examples/demo/simple_polar.py rename to chaco/examples/demo/simple_polar.py diff --git a/examples/demo/stacked_axis.py b/chaco/examples/demo/stacked_axis.py similarity index 100% rename from examples/demo/stacked_axis.py rename to chaco/examples/demo/stacked_axis.py diff --git a/examples/demo/status_overlay.py b/chaco/examples/demo/status_overlay.py similarity index 100% rename from examples/demo/status_overlay.py rename to chaco/examples/demo/status_overlay.py diff --git a/examples/demo/tornado.py b/chaco/examples/demo/tornado.py similarity index 100% rename from examples/demo/tornado.py rename to chaco/examples/demo/tornado.py diff --git a/examples/demo/two_plots.py b/chaco/examples/demo/two_plots.py similarity index 100% rename from examples/demo/two_plots.py rename to chaco/examples/demo/two_plots.py diff --git a/examples/demo/vanderwaals.py b/chaco/examples/demo/vanderwaals.py similarity index 100% rename from examples/demo/vanderwaals.py rename to chaco/examples/demo/vanderwaals.py diff --git a/examples/demo/vertical_plot.py b/chaco/examples/demo/vertical_plot.py similarity index 100% rename from examples/demo/vertical_plot.py rename to chaco/examples/demo/vertical_plot.py diff --git a/examples/demo/xray_plot.py b/chaco/examples/demo/xray_plot.py similarity index 100% rename from examples/demo/xray_plot.py rename to chaco/examples/demo/xray_plot.py From 1085ce7cdb759b5068d14029a89cb9deaeb60145 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Wed, 2 Jun 2021 16:39:20 -0500 Subject: [PATCH 07/24] typo --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 69019fd70..fb1324fa3 100644 --- a/setup.py +++ b/setup.py @@ -335,8 +335,8 @@ def resolve_version(): entry_points={ "etsdemo_data": [ "chaco_examples = chaco.examples._etsdemo_info:info", - 'chaco.examples': ['demo/*', 'demo/*/*'], - ] + ], + "chaco.examples": ["demo/*", "demo/*/*"], }, package_data={ 'chaco': [ From f7bb5624bfd9dd803a28c924b3eabbd7857f8b6e Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Wed, 2 Jun 2021 17:27:39 -0500 Subject: [PATCH 08/24] add asynchronous_updates example --- chaco/__init__.py | 2 +- .../examples}/demo/advanced/asynchronous_updates.py | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {examples => chaco/examples}/demo/advanced/asynchronous_updates.py (100%) diff --git a/chaco/__init__.py b/chaco/__init__.py index 21b2908e1..334c304a3 100644 --- a/chaco/__init__.py +++ b/chaco/__init__.py @@ -11,5 +11,5 @@ __requires__ = ["traits", "traitsui", "pyface", "numpy", "enable"] __extras_require__ = { - 'examples': ['scipy', 'mayavi'] + 'examples': ['encore', 'scipy', 'mayavi'] } diff --git a/examples/demo/advanced/asynchronous_updates.py b/chaco/examples/demo/advanced/asynchronous_updates.py similarity index 100% rename from examples/demo/advanced/asynchronous_updates.py rename to chaco/examples/demo/advanced/asynchronous_updates.py From bae666159187eea7da6aac5072a8e6ffe7a158d7 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Thu, 3 Jun 2021 12:01:54 -0500 Subject: [PATCH 09/24] fix accidental placement into entry_points not package_data --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index fb1324fa3..d103c9824 100644 --- a/setup.py +++ b/setup.py @@ -335,15 +335,15 @@ def resolve_version(): entry_points={ "etsdemo_data": [ "chaco_examples = chaco.examples._etsdemo_info:info", - ], - "chaco.examples": ["demo/*", "demo/*/*"], + ] }, package_data={ 'chaco': [ 'overlays/layers/data/*.svg', 'tests/data/PngSuite/*.png', 'tools/toolbars/images/*.png', - ] + ], + "chaco.examples": ["demo/*", "demo/*/*"], }, description='interactive 2-dimensional plotting', long_description=open('README.rst').read(), From cdefe9a0754594636981460e687517f031500a96 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Thu, 3 Jun 2021 12:40:59 -0500 Subject: [PATCH 10/24] add toolbar_plot and chaco_trait_editor examples --- {examples => chaco/examples}/demo/chaco_trait_editor.py | 0 {examples => chaco/examples}/demo/toolbar_plot.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {examples => chaco/examples}/demo/chaco_trait_editor.py (100%) rename {examples => chaco/examples}/demo/toolbar_plot.py (100%) diff --git a/examples/demo/chaco_trait_editor.py b/chaco/examples/demo/chaco_trait_editor.py similarity index 100% rename from examples/demo/chaco_trait_editor.py rename to chaco/examples/demo/chaco_trait_editor.py diff --git a/examples/demo/toolbar_plot.py b/chaco/examples/demo/toolbar_plot.py similarity index 100% rename from examples/demo/toolbar_plot.py rename to chaco/examples/demo/toolbar_plot.py From 6c73f5391390875a923b337fbabff23ea1185eaa Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Thu, 3 Jun 2021 12:51:46 -0500 Subject: [PATCH 11/24] update tox.ini --- tox.ini | 124 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/tox.ini b/tox.ini index 6d99e8afb..6f43a21d5 100644 --- a/tox.ini +++ b/tox.ini @@ -114,77 +114,77 @@ exclude = chaco/scales/tests/test_scales.py chaco/scales/tests/test_formatters.py examples/demo/financial_plot.py - examples/demo/quiver.py - examples/demo/scales_test.py - examples/demo/qt_example.py - examples/demo/chaco_trait_editor.py + chaco/examples/demo/quiver.py + chaco/examples/demo/scales_test.py + chaco/examples/demo/qt_example.py + chaco/examples/demo/chaco_trait_editor.py examples/demo/multiaxis_using_Plot.py - examples/demo/vertical_plot.py - examples/demo/stacked_axis.py - examples/demo/simple_line.py - examples/demo/edit_line.py - examples/demo/bigdata.py - examples/demo/simple_polar.py - examples/demo/range_selection_demo.py + chaco/examples/demo/vertical_plot.py + chaco/examples/demo/stacked_axis.py + chaco/examples/demo/simple_line.py + chaco/examples/demo/edit_line.py + chaco/examples/demo/bigdata.py + chaco/examples/demo/simple_polar.py + chaco/examples/demo/range_selection_demo.py examples/demo/depth.py - examples/demo/multi_line_plot_demo.py - examples/demo/coordinate_line_overlay_demo.py - examples/demo/cursor_tool_demo.py - examples/demo/toolbar_plot.py + chaco/examples/demo/multi_line_plot_demo.py + chaco/examples/demo/coordinate_line_overlay_demo.py + chaco/examples/demo/cursor_tool_demo.py + chaco/examples/demo/toolbar_plot.py examples/demo/world_map.py examples/demo/financial_plot_dates.py - examples/demo/advanced/asynchronous_updates.py + chaco/examples/demo/advanced/asynchronous_updates.py examples/demo/advanced/spec_waterfall.py - examples/demo/advanced/data_cube.py - examples/demo/advanced/scalar_image_function_inspector.py + chaco/examples/demo/advanced/data_cube.py + chaco/examples/demo/advanced/scalar_image_function_inspector.py examples/demo/advanced/javascript_hover_tools.py - examples/demo/advanced/cmap_variable_sized_scatter.py + chaco/examples/demo/advanced/cmap_variable_sized_scatter.py examples/demo/zoomed_plot/wav_to_numeric.py examples/demo/zoomed_plot/zoom_overlay.py examples/demo/zoomed_plot/zoom_plot.py - examples/demo/financial/correlations.py - examples/demo/financial/stock_prices.py - examples/demo/basic/image_inspector.py - examples/demo/basic/draw_layers.py - examples/demo/basic/regression.py - examples/demo/basic/scatter_variable_size.py - examples/demo/basic/log_plot.py - examples/demo/basic/scatter_toggle.py - examples/demo/basic/scatter_1d.py - examples/demo/basic/cmap_image_plot.py - examples/demo/basic/scatter_alpha.py - examples/demo/basic/candle.py - examples/demo/basic/inset_plot.py - examples/demo/basic/nans_plot.py - examples/demo/basic/grid_container_aspect_ratio.py - examples/demo/basic/contour_plot.py - examples/demo/basic/image_lasso.py - examples/demo/basic/scatter_inspector.py - examples/demo/basic/discrete_cmap_scatter.py - examples/demo/basic/cmap_image_aspect_ratio.py - examples/demo/basic/bounded_grids.py - examples/demo/basic/segment_plot.py - examples/demo/basic/image_from_file.py - examples/demo/basic/scatter.py - examples/demo/basic/contour_cmap_plot.py - examples/demo/basic/line_plot_hold.py - examples/demo/basic/scatter_custom_marker.py - examples/demo/basic/cmap_segment_plot.py - examples/demo/basic/hittest_tool.py - examples/demo/basic/horizon_plot.py - examples/demo/basic/discrete_cmap_image_plot.py - examples/demo/basic/tabbed_plots.py - examples/demo/basic/cmap_image_select.py - examples/demo/basic/zoomable_colorbar.py - examples/demo/basic/polygon_move.py - examples/demo/basic/image_plot.py - examples/demo/basic/grid_container.py - examples/demo/basic/cmap_scatter.py - examples/demo/basic/scatter_inspector2.py - examples/demo/basic/line_plot1.py - examples/demo/basic/scatter_select.py - examples/demo/basic/line_drawing.py - examples/demo/basic/scrollbar.py + chaco/examples/demo/financial/correlations.py + chaco/examples/demo/financial/stock_prices.py + chaco/examples/demo/basic/image_inspector.py + chaco/examples/demo/basic/draw_layers.py + chaco/examples/demo/basic/regression.py + chaco/examples/demo/basic/scatter_variable_size.py + chaco/examples/demo/basic/log_plot.py + chaco/examples/demo/basic/scatter_toggle.py + chaco/examples/demo/basic/scatter_1d.py + chaco/examples/demo/basic/cmap_image_plot.py + chaco/examples/demo/basic/scatter_alpha.py + chaco/examples/demo/basic/candle.py + chaco/examples/demo/basic/inset_plot.py + chaco/examples/demo/basic/nans_plot.py + chaco/examples/demo/basic/grid_container_aspect_ratio.py + chaco/examples/demo/basic/contour_plot.py + chaco/examples/demo/basic/image_lasso.py + chaco/examples/demo/basic/scatter_inspector.py + chaco/examples/demo/basic/discrete_cmap_scatter.py + chaco/examples/demo/basic/cmap_image_aspect_ratio.py + chaco/examples/demo/basic/bounded_grids.py + chaco/examples/demo/basic/segment_plot.py + chaco/examples/demo/basic/image_from_file.py + chaco/examples/demo/basic/scatter.py + chaco/examples/demo/basic/contour_cmap_plot.py + chaco/examples/demo/basic/line_plot_hold.py + chaco/examples/demo/basic/scatter_custom_marker.py + chaco/examples/demo/basic/cmap_segment_plot.py + chaco/examples/demo/basic/hittest_tool.py + chaco/examples/demo/basic/horizon_plot.py + chaco/examples/demo/basic/discrete_cmap_image_plot.py + chaco/examples/demo/basic/tabbed_plots.py + chaco/examples/demo/basic/cmap_image_select.py + chaco/examples/demo/basic/zoomable_colorbar.py + chaco/examples/demo/basic/polygon_move.py + chaco/examples/demo/basic/image_plot.py + chaco/examples/demo/basic/grid_container.py + chaco/examples/demo/basic/cmap_scatter.py + chaco/examples/demo/basic/scatter_inspector2.py + chaco/examples/demo/basic/line_plot1.py + chaco/examples/demo/basic/scatter_select.py + chaco/examples/demo/basic/line_drawing.py + chaco/examples/demo/basic/scrollbar.py examples/demo/canvas/cliptest.py examples/demo/canvas/transient_plot_overlay.py examples/demo/canvas/axis_tool.py From 97112f6861cfa359bb09012674d230a95086830d Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Thu, 3 Jun 2021 13:54:28 -0500 Subject: [PATCH 12/24] remove mayavi as an examples dep --- chaco/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chaco/__init__.py b/chaco/__init__.py index 334c304a3..4cbb88955 100644 --- a/chaco/__init__.py +++ b/chaco/__init__.py @@ -11,5 +11,5 @@ __requires__ = ["traits", "traitsui", "pyface", "numpy", "enable"] __extras_require__ = { - 'examples': ['encore', 'scipy', 'mayavi'] + 'examples': ['encore', 'scipy'] } From 6096b086733de9a33c77ee81bf614dcf3fd9671c Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Thu, 3 Jun 2021 14:00:21 -0500 Subject: [PATCH 13/24] define demo variable for use in etsdemo --- chaco/examples/demo/chaco_trait_editor.py | 19 ++++++++----------- chaco/examples/demo/hyetograph.py | 6 ++++-- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/chaco/examples/demo/chaco_trait_editor.py b/chaco/examples/demo/chaco_trait_editor.py index d25365525..413a95d95 100644 --- a/chaco/examples/demo/chaco_trait_editor.py +++ b/chaco/examples/demo/chaco_trait_editor.py @@ -3,7 +3,7 @@ interval. """ - +from traits.api import HasTraits from traits.etsconfig.api import ETSConfig if ETSConfig.toolkit == "wx": @@ -11,7 +11,7 @@ else: from traitsui.qt4.editor import Editor -from traitsui.api import EditorFactory +from traitsui.api import EditorFactory, Item, View from enable.api import ColorTrait, Window @@ -173,18 +173,15 @@ def update_editor(self): IntervalEditor = IntervalEditorFactory -# --- Demonstration --- - -if __name__ == "__main__": - from traits.api import HasTraits - from traitsui.api import View, Item - - class IntervalTest(HasTraits): +class IntervalTest(HasTraits): interval = Interval(low=0, high=1) traits_view = View( Item("interval", editor=IntervalEditor()), resizable=True ) - it = IntervalTest() - it.configure_traits() + +demo = IntervalTest() + +if __name__ == "__main__": + demo.configure_traits() diff --git a/chaco/examples/demo/hyetograph.py b/chaco/examples/demo/hyetograph.py index 8ca85f282..be94e4216 100644 --- a/chaco/examples/demo/hyetograph.py +++ b/chaco/examples/demo/hyetograph.py @@ -144,6 +144,8 @@ def start(self): ) +demo = Hyetograph() + + if __name__ == "__main__": - hyetograph = Hyetograph() - hyetograph.start() + demo.start() From 09d8d2290a7e2d1fb7fe4eeced37d95c46a2ec11 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Thu, 3 Jun 2021 16:03:59 -0500 Subject: [PATCH 14/24] update hyetograph so that it works with etsdemo --- chaco/examples/demo/hyetograph.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/chaco/examples/demo/hyetograph.py b/chaco/examples/demo/hyetograph.py index be94e4216..047ac7180 100644 --- a/chaco/examples/demo/hyetograph.py +++ b/chaco/examples/demo/hyetograph.py @@ -1,6 +1,7 @@ from chaco.api import ArrayPlotData, Plot from enable.api import ComponentEditor from traits.api import ( + Bool, HasTraits, Instance, Int, @@ -43,6 +44,12 @@ class Hyetograph(HasTraits): nrcs_plot = Instance(Plot) + initialized = Bool(False) + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.initialized = True + def _intensity_plot_default(self): intensity_plot = Plot(ArrayPlotData(x=self.timeline, y=self.intensity)) intensity_plot.x_axis.title = "Time (hr)" @@ -104,7 +111,7 @@ def calculate_runoff(self): vr[i] = 0 self.nrcs = vr - @observe('duration, year_storm, county, curve_number') + @observe('duration, year_storm, county, curve_number, initialized') def _perform_calculations(self, event=None): self.calculate_intensity() self.calculate_runoff() @@ -126,10 +133,6 @@ def _update_polt_type(self, event): self.intensity_plot.invalidate_and_redraw() self.nrcs_plot.invalidate_and_redraw() - def start(self): - self._perform_calculations() - self.configure_traits() - traits_view = View( Item('plot_type'), Item("intensity_plot", editor=ComponentEditor()), @@ -144,8 +147,8 @@ def start(self): ) -demo = Hyetograph() +popup = Hyetograph() if __name__ == "__main__": - demo.start() + popup.configure_traits() From 666598a47a5d7bcf96be3b55de1548a74410ea2f Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Thu, 3 Jun 2021 16:04:22 -0500 Subject: [PATCH 15/24] update various examples to work within etsdemo application --- .../demo/image_plot_origin_and_orientation.py | 9 +++-- chaco/examples/demo/multi_line_plot_demo.py | 38 ++++++++++--------- .../examples/demo/nonlinear_color_mapping.py | 14 ++++--- chaco/examples/demo/status_overlay.py | 7 +++- chaco/examples/demo/vanderwaals.py | 6 ++- chaco/examples/demo/xray_plot.py | 6 ++- 6 files changed, 46 insertions(+), 34 deletions(-) diff --git a/chaco/examples/demo/image_plot_origin_and_orientation.py b/chaco/examples/demo/image_plot_origin_and_orientation.py index 7802c3e28..5aed02c20 100644 --- a/chaco/examples/demo/image_plot_origin_and_orientation.py +++ b/chaco/examples/demo/image_plot_origin_and_orientation.py @@ -3,10 +3,11 @@ The origin parameter sets a plot's default origin to the specified corner of the plot window. These positions has the following behavior: - * 'left' : index increases left to right - * 'right' : index increases right to left - * 'top' : index increases top to bottom - * 'bottom' : index increases bottom to top + +* 'left' : index increases left to right +* 'right' : index increases right to left +* 'top' : index increases top to bottom +* 'bottom' : index increases bottom to top The orientation parameter switches the x- and y-axes. Alternatively, you can think of this as a transpose about the origin. diff --git a/chaco/examples/demo/multi_line_plot_demo.py b/chaco/examples/demo/multi_line_plot_demo.py index e52946cdb..183341db0 100644 --- a/chaco/examples/demo/multi_line_plot_demo.py +++ b/chaco/examples/demo/multi_line_plot_demo.py @@ -138,23 +138,25 @@ def _offset_changed(self, off): self.multi_line_plot_renderer._amplitude_changed() +# Sample rate. +fs = 500 +# Total time. +T = 5.0 +num_samples = fs * T +t = np.arange(num_samples) / fs + +channels = np.arange(12) +# Frequencies of the sine functions in each channel. +freqs = 3 * (channels[:, None] + 1) +y = np.sin(freqs * t) + +# Create an instance of DataModel. This is the data to +# be plotted with a MultiLinePlot. +data = DataModel(x_index=t, y_index=channels, data=y) + +# Create the demo class, and show it. +demo = MultiLinePlotDemo(model=data) + + if __name__ == "__main__": - # Sample rate. - fs = 500 - # Total time. - T = 5.0 - num_samples = fs * T - t = np.arange(num_samples) / fs - - channels = np.arange(12) - # Frequencies of the sine functions in each channel. - freqs = 3 * (channels[:, None] + 1) - y = np.sin(freqs * t) - - # Create an instance of DataModel. This is the data to - # be plotted with a MultiLinePlot. - data = DataModel(x_index=t, y_index=channels, data=y) - - # Create the demo class, and show it. - demo = MultiLinePlotDemo(model=data) demo.configure_traits() diff --git a/chaco/examples/demo/nonlinear_color_mapping.py b/chaco/examples/demo/nonlinear_color_mapping.py index b0849e0e3..492bec86c 100644 --- a/chaco/examples/demo/nonlinear_color_mapping.py +++ b/chaco/examples/demo/nonlinear_color_mapping.py @@ -272,11 +272,13 @@ def _colorbar_scale_changed(self): self.colorbar.index_mapper = new_mapper +grid = DataGrid( + func=lambda x, y: 3.0 ** (x ** 2 + 2 * (cos(2 * pi * y) - 1)), + domain_bounds=(0.0, 0.0, 2.0, 2.0), + grid_size=(200, 200), +) +demo = DataGridView(model=grid) + + if __name__ == "__main__": - grid = DataGrid( - func=lambda x, y: 3.0 ** (x ** 2 + 2 * (cos(2 * pi * y) - 1)), - domain_bounds=(0.0, 0.0, 2.0, 2.0), - grid_size=(200, 200), - ) - demo = DataGridView(model=grid) demo.configure_traits() diff --git a/chaco/examples/demo/status_overlay.py b/chaco/examples/demo/status_overlay.py index b5cb4b465..893ce5536 100644 --- a/chaco/examples/demo/status_overlay.py +++ b/chaco/examples/demo/status_overlay.py @@ -82,5 +82,8 @@ def clear_status(self): ) -my_plot = MyPlot() -my_plot.configure_traits() +demo = MyPlot() + + +if __name__ == '__main__': + demo.configure_traits() diff --git a/chaco/examples/demo/vanderwaals.py b/chaco/examples/demo/vanderwaals.py index 1ca4d8f59..af600fe21 100644 --- a/chaco/examples/demo/vanderwaals.py +++ b/chaco/examples/demo/vanderwaals.py @@ -97,6 +97,8 @@ def _update_plot_type(self, event): ) +popup = Data() + + if __name__ == '__main__': - viewer = Data() - viewer.configure_traits() + popup.configure_traits() diff --git a/chaco/examples/demo/xray_plot.py b/chaco/examples/demo/xray_plot.py index f606614c0..679bce4c2 100644 --- a/chaco/examples/demo/xray_plot.py +++ b/chaco/examples/demo/xray_plot.py @@ -172,5 +172,7 @@ def _plot_default(self): ) -example = PlotExample() -example.configure_traits() +demo = PlotExample() + +if __name__ == '__main__': + demo.configure_traits() From 465747af4044e835967c410b0dbac09ab1a30650 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Thu, 3 Jun 2021 16:08:58 -0500 Subject: [PATCH 16/24] add comment that qt_example.py will not work in etsdemo app --- chaco/examples/demo/qt_example.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chaco/examples/demo/qt_example.py b/chaco/examples/demo/qt_example.py index d4b6ea8c0..26cf8c4d7 100644 --- a/chaco/examples/demo/qt_example.py +++ b/chaco/examples/demo/qt_example.py @@ -2,6 +2,9 @@ Example of how to directly embed Chaco into Qt widgets. The actual plot being created is drawn from the basic/line_plot1.py code. + +This demo is intended to be run standalone and will not work within the etsdemo +application. """ from traits.etsconfig.etsconfig import ETSConfig From 2a268681cfc32af4dfade6de976a2415071af856 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Thu, 3 Jun 2021 16:35:17 -0500 Subject: [PATCH 17/24] make scalar_image_function_inspector.py work in etsdemo --- .../demo/advanced/scalar_image_function_inspector.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/chaco/examples/demo/advanced/scalar_image_function_inspector.py b/chaco/examples/demo/advanced/scalar_image_function_inspector.py index 246ef44fd..01751bc4c 100644 --- a/chaco/examples/demo/advanced/scalar_image_function_inspector.py +++ b/chaco/examples/demo/advanced/scalar_image_function_inspector.py @@ -621,12 +621,8 @@ def configure_traits(self, *args, **kws): return super(ModelView, self).configure_traits(*args, **kws) -def show_plot(**kwargs): - model = Model(**kwargs) - view = PlotUI(**kwargs) - modelview = ModelView(model=model, view=view) - modelview.configure_traits() +demo = ModelView(model=Model(), view=PlotUI()) if __name__ == "__main__": - show_plot() + demo.configure_traits() From 4cdca8cea039211794c12302194eb3d0642ea7ae Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Thu, 3 Jun 2021 17:06:19 -0500 Subject: [PATCH 18/24] make a few other examples work inside etsdemo --- chaco/__init__.py | 2 +- chaco/examples/demo/basic/horizon_plot.py | 8 +++----- chaco/examples/demo/basic/minor_ticks_axis.py | 5 ++++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/chaco/__init__.py b/chaco/__init__.py index 4cbb88955..9f7fbac9e 100644 --- a/chaco/__init__.py +++ b/chaco/__init__.py @@ -11,5 +11,5 @@ __requires__ = ["traits", "traitsui", "pyface", "numpy", "enable"] __extras_require__ = { - 'examples': ['encore', 'scipy'] + 'examples': ['encore', 'scipy', 'pandas'] } diff --git a/chaco/examples/demo/basic/horizon_plot.py b/chaco/examples/demo/basic/horizon_plot.py index 8c9f890c7..9f199536b 100644 --- a/chaco/examples/demo/basic/horizon_plot.py +++ b/chaco/examples/demo/basic/horizon_plot.py @@ -186,11 +186,9 @@ class Demo(HasTraits): ) -demo = Demo() +filled, horizon = _create_plot_components() +demo = Demo(horizon=horizon, filled=filled) -if __name__ == "__main__": - filled, horizon = _create_plot_components() - demo.horizon = horizon - demo.filled = filled +if __name__ == "__main__": demo.configure_traits() diff --git a/chaco/examples/demo/basic/minor_ticks_axis.py b/chaco/examples/demo/basic/minor_ticks_axis.py index 06dc046df..e7b72752e 100644 --- a/chaco/examples/demo/basic/minor_ticks_axis.py +++ b/chaco/examples/demo/basic/minor_ticks_axis.py @@ -57,6 +57,9 @@ def _plot_default(self): return plot +demo = MinorTickDemo() + + if __name__ == "__main__": - demo = MinorTickDemo() + demo.configure_traits() From 157500d75cfbe33a94440284a2e148f54d2dfc4b Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Thu, 3 Jun 2021 17:18:41 -0500 Subject: [PATCH 19/24] make examples using DemoFrame and demo_main work in etsdemo --- chaco/examples/demo/advanced/data_cube.py | 4 ++-- chaco/examples/demo/financial/stock_prices.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/chaco/examples/demo/advanced/data_cube.py b/chaco/examples/demo/advanced/data_cube.py index 396e7af04..29a05bd47 100644 --- a/chaco/examples/demo/advanced/data_cube.py +++ b/chaco/examples/demo/advanced/data_cube.py @@ -192,7 +192,7 @@ def normal_mouse_wheel(self, event): self.wheel_cb(self, event.mouse_wheel) -class PlotFrame(DemoFrame): +class Demo(DemoFrame): # These are the indices into the cube that each of the image plot views # will show; the default values are non-zero just to make it a little @@ -466,6 +466,6 @@ def cleanup_data(): if __name__ == "__main__": # Save demo so that it doesn't get garbage collected when run within # existing event loop (i.e. from ipython). - demo = demo_main(PlotFrame, size=(800, 700), title="Cube analyzer") + demo = demo_main(Demo, size=(800, 700), title="Cube analyzer") if run_cleanup: cleanup_data() diff --git a/chaco/examples/demo/financial/stock_prices.py b/chaco/examples/demo/financial/stock_prices.py index 16f91dec0..cc9a7ebc7 100644 --- a/chaco/examples/demo/financial/stock_prices.py +++ b/chaco/examples/demo/financial/stock_prices.py @@ -60,7 +60,7 @@ def create_dates(numpoints, units="days"): return dates -class PlotFrame(DemoFrame): +class Demo(DemoFrame): def _create_price_plots(self, times, prices, mini_height=75): """Creates the two plots of prices and returns them. One of the plots can be zoomed and panned, and the other plot (smaller) always @@ -221,5 +221,5 @@ def _create_component(self): # Save demo so that it doesn't get garbage collected when run within # existing event loop (i.e. from ipython). demo = demo_main( - PlotFrame, size=(800, 600), title="Stock price and volume" + Demo, size=(800, 600), title="Stock price and volume" ) From 66d7c8713ca637b75bcf111f5ac74dbf2c3fc6ce Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Thu, 3 Jun 2021 17:21:08 -0500 Subject: [PATCH 20/24] flake8 --- chaco/examples/demo/basic/minor_ticks_axis.py | 1 - 1 file changed, 1 deletion(-) diff --git a/chaco/examples/demo/basic/minor_ticks_axis.py b/chaco/examples/demo/basic/minor_ticks_axis.py index e7b72752e..8189a70a4 100644 --- a/chaco/examples/demo/basic/minor_ticks_axis.py +++ b/chaco/examples/demo/basic/minor_ticks_axis.py @@ -61,5 +61,4 @@ def _plot_default(self): if __name__ == "__main__": - demo.configure_traits() From 67964ed30bf88ce8c1b62eacce6aafa37453d254 Mon Sep 17 00:00:00 2001 From: aaronayres35 <36972686+aaronayres35@users.noreply.github.com> Date: Mon, 7 Jun 2021 07:46:10 -0500 Subject: [PATCH 21/24] Update chaco/examples/tests/test_etsdemo_info.py Co-authored-by: Poruri Sai Rahul --- chaco/examples/tests/test_etsdemo_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chaco/examples/tests/test_etsdemo_info.py b/chaco/examples/tests/test_etsdemo_info.py index ba0b40fbd..323fdf529 100644 --- a/chaco/examples/tests/test_etsdemo_info.py +++ b/chaco/examples/tests/test_etsdemo_info.py @@ -1,4 +1,4 @@ -# (C) Copyright 2011-2020 Enthought, Inc., Austin, TX +# (C) Copyright 2005-2020 Enthought, Inc., Austin, TX # All rights reserved. # # This software is provided without warranty under the terms of the BSD From 55e42f03aad2d335be4bc79caae3ed3112f0b052 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Mon, 7 Jun 2021 08:17:10 -0500 Subject: [PATCH 22/24] rename ModelView as DemoModelView --- .../demo/advanced/scalar_image_function_inspector.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/chaco/examples/demo/advanced/scalar_image_function_inspector.py b/chaco/examples/demo/advanced/scalar_image_function_inspector.py index 01751bc4c..772626424 100644 --- a/chaco/examples/demo/advanced/scalar_image_function_inspector.py +++ b/chaco/examples/demo/advanced/scalar_image_function_inspector.py @@ -454,8 +454,8 @@ class TimerController(HasTraits): # The plot view which will be affected by timed animation view = Instance(PlotUI) - # The ModelView instance that contains the animation options: - model_view = Instance("ModelView") + # The DemoModelView instance that contains the animation options: + model_view = Instance("DemoModelView") # Whether the view is animated: animated = DelegatesTo("model_view") @@ -556,7 +556,7 @@ def randomize(new_direction=1, color_change=False): metadata["selections"] = x, y -class ModelView(HasTraits): +class DemoModelView(HasTraits): model = Instance(Model) view = Instance(PlotUI) @@ -614,14 +614,14 @@ def _start_timer(self): def edit_traits(self, *args, **kws): self._start_timer() - return super(ModelView, self).edit_traits(*args, **kws) + return super(DemoModelView, self).edit_traits(*args, **kws) def configure_traits(self, *args, **kws): self._start_timer() - return super(ModelView, self).configure_traits(*args, **kws) + return super(DemoModelView, self).configure_traits(*args, **kws) -demo = ModelView(model=Model(), view=PlotUI()) +demo = DemoModelView(model=Model(), view=PlotUI()) if __name__ == "__main__": From 0b2ec2987489647c5819191d356875c75a9dce0a Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Mon, 7 Jun 2021 08:22:45 -0500 Subject: [PATCH 23/24] fix scatter_inspector2 --- .../examples/demo/basic/scatter_inspector2.py | 68 +++++++++---------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/chaco/examples/demo/basic/scatter_inspector2.py b/chaco/examples/demo/basic/scatter_inspector2.py index a1f2a6ef8..6703e64b7 100644 --- a/chaco/examples/demo/basic/scatter_inspector2.py +++ b/chaco/examples/demo/basic/scatter_inspector2.py @@ -54,42 +54,40 @@ def show_data(data_idx): return show_data -if __name__ == "__main__": +def _create_plot_component(): + # Create a fake dataset from which 2 dimensions will be displayed in a + # scatter plot: + x = np.random.uniform(0.0, 10.0, 50) + y = np.random.uniform(0.0, 5.0, 50) + data = pd.DataFrame( + {"x": x, "y": y, "dataset": np.random.choice(list("abcdefg"), 50)} + ) + plot_data = ArrayPlotData(x=x, y=y) + plot = Plot(plot_data) + scatter = plot.plot(("x", "y"), type="scatter")[0] + + # Attach the inspector and its overlays + inspector = DataframeScatterInspector(component=scatter, data=data) + scatter.tools.append(inspector) + + text_overlay = DataframeScatterOverlay( + component=plot, + inspector=inspector, + bgcolor="black", + alpha=0.6, + text_color="white", + border_color="none", + ) + plot.overlays.append(text_overlay) - def _create_plot_component(): - # Create a fake dataset from which 2 dimensions will be displayed in a - # scatter plot: - x = np.random.uniform(0.0, 10.0, 50) - y = np.random.uniform(0.0, 5.0, 50) - data = pd.DataFrame( - {"x": x, "y": y, "dataset": np.random.choice(list("abcdefg"), 50)} - ) - plot_data = ArrayPlotData(x=x, y=y) - plot = Plot(plot_data) - scatter = plot.plot(("x", "y"), type="scatter")[0] - - # Attach the inspector and its overlays - inspector = DataframeScatterInspector(component=scatter, data=data) - scatter.tools.append(inspector) - - text_overlay = DataframeScatterOverlay( - component=plot, - inspector=inspector, - bgcolor="black", - alpha=0.6, - text_color="white", - border_color="none", - ) - plot.overlays.append(text_overlay) - - # Optional: add an overlay on the point to confirm what is hovered over - # Note that this overlay magically knows about hovered points by - # listening to renderer events rather than inspector events: - point_overlay = ScatterInspectorOverlay( - component=scatter, hover_color="red", hover_marker_size=6 - ) - scatter.overlays.append(point_overlay) - return plot + # Optional: add an overlay on the point to confirm what is hovered over + # Note that this overlay magically knows about hovered points by + # listening to renderer events rather than inspector events: + point_overlay = ScatterInspectorOverlay( + component=scatter, hover_color="red", hover_marker_size=6 + ) + scatter.overlays.append(point_overlay) + return plot # ============================================================================= From 6cd299cb83e4501edcf1661baae535e80f748de4 Mon Sep 17 00:00:00 2001 From: Aaron Ayres Date: Mon, 7 Jun 2021 08:25:27 -0500 Subject: [PATCH 24/24] remove todo list --- chaco/examples/demo/advanced/data_cube.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/chaco/examples/demo/advanced/data_cube.py b/chaco/examples/demo/advanced/data_cube.py index 29a05bd47..5d27ccb7a 100644 --- a/chaco/examples/demo/advanced/data_cube.py +++ b/chaco/examples/demo/advanced/data_cube.py @@ -6,13 +6,6 @@ import warnings -# Outstanding TODOs: -# - need to add line inspectors to side and bottom plots, and synchronize -# with center plot -# - need to set the various image plots to use the same colormap instance, -# and that colormap's range needs to be set to min/max of the entire cube -# - refactor create_window() so there is less code duplication -# - try to eliminate the use of model.xs, ys, zs in favor of bounds tuples from numpy import amin, amax, zeros, fromfile, transpose, uint8 # Standard library imports