From 99718e8748a8cad156971f64dad144bcaf0bd2d7 Mon Sep 17 00:00:00 2001 From: Tony Tung Date: Tue, 23 Apr 2019 00:52:44 -0700 Subject: [PATCH] RFC: public/private separation Some basic rules of thumb: 1. `starfish.core` code should never reference `starfish`. 2. tests in `starfish.core` should generally reference `starfish` whenever possible. exception: imports in tests for package X should use relative imports to its enclosing package whenever possible. for example, importing `ImageStack` from `ImageStack` tests should be done as `from ..imagestack import ImageStack`. Rationale: it's easy to move code around without breaking references. 3. notebook/vignette code should never use `starfish.core`. I also created some public APIs where they did not previously exist. Basically, go check out what was added in `starfish/` --- .flake8 | 2 +- .../format_imc_data.py | 2 +- .../format_osmfish.py | 2 +- .../format_starmap.py | 2 +- docs/source/api/data_structures/codebook.rst | 2 +- .../source/api/data_structures/experiment.rst | 2 +- .../api/data_structures/expression_matrix.rst | 2 +- .../api/data_structures/field_of_view.rst | 2 +- .../api/data_structures/image_stack.rst | 2 +- .../api/data_structures/intensity_table.rst | 4 +- .../data_structures/pipeline_component.rst | 2 +- docs/source/api/recipe/index.rst | 2 +- docs/source/api/types/index.rst | 12 ++--- docs/source/api/validation/index.rst | 6 +-- .../getting_started/formatting_data/index.rst | 4 +- notebooks/ISS.ipynb | 2 +- notebooks/STARmap.ipynb | 18 +++---- notebooks/py/ISS.py | 2 +- setup.py | 2 +- starfish/__init__.py | 51 ++++++++----------- starfish/__main__.py | 3 -- starfish/config.py | 1 + starfish/core/__init__.py | 16 ++++++ starfish/{ => core}/_display.py | 6 +-- starfish/{ => core}/_version.py | 0 starfish/{ => core}/codebook/__init__.py | 0 starfish/{ => core}/codebook/_format.py | 0 starfish/{ => core}/codebook/codebook.py | 16 +++--- starfish/{ => core}/codebook/test/__init__.py | 0 .../{ => core}/codebook/test/factories.py | 4 +- .../test/test_approximate_nearest_code.py | 0 .../codebook/test/test_code_length.py | 2 +- .../codebook/test/test_from_code_array.py | 4 +- .../codebook/test/test_metric_decode.py | 5 +- .../test/test_normalize_code_traces.py | 5 +- .../test/test_per_round_max_decode.py | 5 +- .../test/test_synthetic_one_hot_codebook.py | 4 +- starfish/{ => core}/compat.py | 0 starfish/{ => core}/config/__init__.py | 8 +-- starfish/{ => core}/config/test/__init__.py | 0 .../{ => core}/config/test/test_config.py | 4 +- starfish/{ => core}/errors.py | 0 .../test => core/experiment}/__init__.py | 0 .../{ => core}/experiment/builder/__init__.py | 8 +-- starfish/{ => core}/experiment/builder/cli.py | 4 +- .../experiment/builder/defaultproviders.py | 2 +- .../{ => core}/experiment/builder/inplace.py | 0 .../experiment/builder/orderediterator.py | 2 +- .../experiment/builder/providers.py | 2 +- .../experiment/builder}/test/__init__.py | 0 .../experiment/builder/test/inplace_script.py | 8 +-- .../experiment/builder/test/test_build.py | 2 +- .../experiment/builder/test/test_inplace.py | 2 +- .../builder/test/test_orderediterator.py | 4 +- starfish/{ => core}/experiment/experiment.py | 10 ++-- .../experiment/test}/__init__.py | 0 .../experiment/test/test_experiment.py | 4 +- .../experiment/test/test_version.py | 4 +- starfish/{ => core}/experiment/version.py | 0 .../expression_matrix}/__init__.py | 0 .../expression_matrix/expression_matrix.py | 2 +- .../expression_matrix}/test/__init__.py | 0 .../test/test_serialization.py | 0 starfish/{ => core}/image/__init__.py | 0 starfish/{ => core}/image/_filter/__init__.py | 2 +- starfish/{ => core}/image/_filter/_base.py | 10 ++-- starfish/{ => core}/image/_filter/bandpass.py | 6 +-- starfish/{ => core}/image/_filter/clip.py | 4 +- .../image/_filter/element_wise_mult.py | 8 +-- .../image/_filter/gaussian_high_pass.py | 10 ++-- .../image/_filter/gaussian_low_pass.py | 8 +-- starfish/{ => core}/image/_filter/laplace.py | 10 ++-- .../image/_filter/linear_unmixing.py | 6 +-- .../image/_filter/match_histograms.py | 8 +-- starfish/{ => core}/image/_filter/max_proj.py | 6 +-- .../image/_filter/mean_high_pass.py | 8 +-- .../_filter/richardson_lucy_deconvolution.py | 6 +-- .../image/_filter/test}/__init__.py | 0 .../image/_filter/test/test_api_contract.py | 4 +- .../image/_filter/test/test_filter.py | 6 +-- .../_filter/test/test_histogram_matching.py | 6 +-- .../_filter/test/test_linear_unmixing.py | 4 +- .../image/_filter/test/test_white_tophat.py | 2 +- .../test/test_zero_by_channel_magnitude.py | 2 +- starfish/{ => core}/image/_filter/util.py | 2 +- .../{ => core}/image/_filter/white_tophat.py | 6 +-- .../_filter/zero_by_channel_magnitude.py | 8 +-- .../image/_registration}/__init__.py | 0 .../_apply_transform/__init__.py | 2 +- .../_registration/_apply_transform/_base.py | 12 ++--- .../_apply_transform}/test/__init__.py | 0 .../_apply_transform/test/test_warp.py | 6 +-- .../_registration/_apply_transform/warp.py | 12 ++--- .../_learn_transform/__init__.py | 2 +- .../_registration/_learn_transform/_base.py | 10 ++-- .../_learn_transform}/test/__init__.py | 0 .../_learn_transform/test/test_translation.py | 4 +- .../_learn_transform/translation.py | 10 ++-- .../image/_registration}/test/__init__.py | 0 .../test/test_transforms_list.py | 6 +-- .../image/_registration/transforms_list.py | 4 +- .../{ => core}/image/_segment/__init__.py | 2 +- starfish/{ => core}/image/_segment/_base.py | 12 ++--- .../{ => core}/image/_segment/watershed.py | 10 ++-- starfish/{ => core}/imagestack/__init__.py | 0 .../{ => core}/imagestack/_mp_dataarray.py | 2 +- starfish/{ => core}/imagestack/dataorder.py | 2 +- starfish/{ => core}/imagestack/imagestack.py | 50 +++++++++--------- .../{ => core}/imagestack/indexing_utils.py | 2 +- .../{ => core}/imagestack/parser/__init__.py | 0 starfish/{ => core}/imagestack/parser/_key.py | 2 +- .../{ => core}/imagestack/parser/_tiledata.py | 2 +- starfish/{ => core}/imagestack/parser/crop.py | 8 +-- .../imagestack/parser/numpy/__init__.py | 4 +- .../imagestack/parser/tileset/__init__.py | 0 .../imagestack/parser/tileset/_parser.py | 6 +-- .../physical_coordinate_calculator.py | 2 +- .../imagestack/test}/__init__.py | 0 .../imagestack/test/factories/__init__.py | 0 .../test/factories/from_codebook.py | 6 +-- .../test/factories/synthetic_stack.py | 8 +-- .../imagestack/test/factories/unique_tiles.py | 8 +-- .../imagestack/test/factories/with_coords.py | 6 +-- .../imagestack/test/imagestack_test_utils.py | 4 +- .../{ => core}/imagestack/test/test_apply.py | 6 +-- .../imagestack/test/test_coordinates.py | 4 +- .../imagestack/test/test_cropped_load.py | 14 ++--- .../{ => core}/imagestack/test/test_export.py | 6 +-- .../imagestack/test/test_from_numpy_array.py | 2 +- .../{ => core}/imagestack/test/test_index.py | 6 +-- .../imagestack/test/test_labeled_indices.py | 4 +- .../imagestack/test/test_max_proj.py | 4 +- .../imagestack/test/test_metadata.py | 4 +- .../imagestack/test/test_slice_ops.py | 2 +- .../imagestack/test/test_slicedimage_dtype.py | 6 +-- .../test => core/intensity_table}/__init__.py | 0 .../{ => core}/intensity_table/concatenate.py | 2 +- .../intensity_table/intensity_table.py | 8 +-- .../intensity_table_coordinates.py | 6 +-- .../{ => core}/intensity_table/overlap.py | 2 +- .../intensity_table/test}/__init__.py | 0 .../intensity_table/test/factories.py | 6 +-- .../intensity_table/test/test_concatenate.py | 2 +- .../test/test_empty_intensity_table.py | 4 +- .../test/test_from_imagestack.py | 9 ++-- .../test/test_from_spot_data.py | 4 +- .../test/test_intensity_table_coords.py | 18 +++---- .../test_intensity_table_serialization.py | 3 +- .../intensity_table/test/test_overlap.py | 8 +-- .../test_stack_intensity_table_reshaping.py | 6 +-- .../test/test_synthetic_intensities.py | 6 +-- .../intensity_table/test/test_to_mermaid.py | 5 +- .../test => core/multiprocessing}/__init__.py | 0 starfish/{ => core}/multiprocessing/pool.py | 0 starfish/{ => core}/multiprocessing/shmem.py | 0 .../multiprocessing}/test/__init__.py | 0 .../test/test_multiprocessing.py | 4 +- starfish/{ => core}/pipeline/__init__.py | 0 starfish/{ => core}/pipeline/algorithmbase.py | 10 ++-- .../{ => core}/pipeline/pipelinecomponent.py | 0 starfish/{ => core}/recipe/__init__.py | 0 starfish/{ => core}/recipe/cli.py | 6 +-- starfish/{ => core}/recipe/errors.py | 0 starfish/{ => core}/recipe/filesystem.py | 10 ++-- starfish/{ => core}/recipe/recipe.py | 0 starfish/{ => core}/recipe/runnable.py | 2 +- .../recipe/test}/__init__.py | 0 starfish/{ => core}/recipe/test/fakefilter.py | 4 +- .../{ => core}/recipe/test/test_recipe.py | 4 +- .../{ => core}/recipe/test/test_runnable.py | 18 +++---- starfish/{ => core}/segmentation_mask.py | 2 +- .../test => core/spacetx_format}/__init__.py | 0 starfish/{ => core}/spacetx_format/cli.py | 2 +- .../spacetx_format/test/test_validate.py | 2 +- .../spacetx_format/test_codebook.py | 2 +- .../spacetx_format/test_coordinates.py | 0 .../spacetx_format/test_experiment.py | 0 .../spacetx_format/test_field_of_view.py | 0 .../spacetx_format/test_fov_manifest.py | 0 .../{ => core}/spacetx_format/test_fuzz.py | 2 +- starfish/{ => core}/spacetx_format/util.py | 0 .../spacetx_format/validate_sptx.py | 8 +-- starfish/{ => core}/spots/__init__.py | 0 .../spots/_assign_targets/__init__.py | 2 +- .../{ => core}/spots/_assign_targets/_base.py | 10 ++-- .../{ => core}/spots/_assign_targets/label.py | 8 +-- starfish/{ => core}/spots/_decode/__init__.py | 2 +- starfish/{ => core}/spots/_decode/_base.py | 10 ++-- .../spots/_decode/metric_decoder.py | 8 +-- .../_decode/per_round_max_channel_decoder.py | 6 +-- .../spots/_detect_pixels/__init__.py | 2 +- .../{ => core}/spots/_detect_pixels/_base.py | 14 ++--- .../combine_adjacent_features.py | 8 +-- .../_detect_pixels/pixel_spot_decoder.py | 10 ++-- .../spots/_detect_pixels}/test/__init__.py | 0 .../test/test_calculate_mean_pixel_traces.py | 4 +- .../test/test_create_spot_attributes.py | 4 +- .../test/test_intensities_to_decoded_image.py | 4 +- .../_detect_pixels/test/test_targets_map.py | 2 +- .../spots/_detect_spots/__init__.py | 2 +- .../{ => core}/spots/_detect_spots/_base.py | 14 ++--- .../{ => core}/spots/_detect_spots/blob.py | 8 +-- .../{ => core}/spots/_detect_spots/detect.py | 8 +-- .../_detect_spots/local_max_peak_finder.py | 10 ++-- .../local_search_blob_detector.py | 14 ++--- .../spots/_detect_spots}/test/__init__.py | 0 .../test/test_local_search_blob_detector.py | 4 +- .../_detect_spots/test/test_spot_detection.py | 14 ++--- .../_detect_spots/test/test_synthetic_data.py | 6 +-- .../trackpy_local_max_peak_finder.py | 8 +-- starfish/{ => core}/starfish.py | 10 ++-- starfish/{types => core}/test/__init__.py | 0 starfish/{ => core}/test/factories.py | 10 ++-- starfish/{ => core}/test/test_profiler.py | 0 .../{ => core}/test/test_segmentation_mask.py | 8 +-- .../test/test_synthetic_spot_creation.py | 6 +-- starfish/{ => core}/types/__init__.py | 0 starfish/{ => core}/types/_constants.py | 0 starfish/{ => core}/types/_decoded_spots.py | 2 +- starfish/{ => core}/types/_spot_attributes.py | 2 +- starfish/{ => core}/types/_validated_table.py | 0 .../types/test/__init__.py} | 0 .../types/test/test_decoded_spots.py | 4 +- starfish/core/util/__init__.py | 0 starfish/{ => core}/util/argparse.py | 0 starfish/{ => core}/util/click/__init__.py | 0 .../{ => core}/util/click/indirectparams.py | 6 +-- .../{ => core}/util/click/test/test_help.py | 2 +- starfish/{ => core}/util/clock.py | 0 starfish/{ => core}/util/config.py | 0 starfish/{ => core}/util/dtype.py | 0 starfish/{ => core}/util/enum.py | 2 +- starfish/{ => core}/util/exec.py | 2 +- .../{ => core}/util/indirectfile/__init__.py | 0 .../{ => core}/util/indirectfile/_base.py | 0 .../{ => core}/util/indirectfile/_codebook.py | 6 +-- .../util/indirectfile/_imagestack.py | 6 +-- starfish/{ => core}/util/logging.py | 8 +-- starfish/{ => core}/util/try_import.py | 0 starfish/experiment/builder.py | 2 + starfish/image.py | 6 +++ starfish/spots.py | 6 +++ .../full_pipelines/api/test_allen_smFISH.py | 16 +++--- .../test/full_pipelines/cli/_base_cli_test.py | 4 +- .../cli/test_allen_smFISH_cli.py | 2 +- .../full_pipelines/cli/test_dartfish_cli.py | 2 +- starfish/test/full_pipelines/cli/test_iss.py | 2 +- .../full_pipelines/cli/test_merfish_cli.py | 3 +- .../recipe/_base_recipe_test.py | 2 +- .../test/full_pipelines/recipe/test_iss.py | 2 +- starfish/types.py | 15 ++++++ starfish/util/plot.py | 5 +- 252 files changed, 589 insertions(+), 553 deletions(-) delete mode 100644 starfish/__main__.py create mode 100644 starfish/config.py create mode 100644 starfish/core/__init__.py rename starfish/{ => core}/_display.py (98%) rename starfish/{ => core}/_version.py (100%) rename starfish/{ => core}/codebook/__init__.py (100%) rename starfish/{ => core}/codebook/_format.py (100%) rename starfish/{ => core}/codebook/codebook.py (98%) rename starfish/{ => core}/codebook/test/__init__.py (100%) rename starfish/{ => core}/codebook/test/factories.py (95%) rename starfish/{ => core}/codebook/test/test_approximate_nearest_code.py (100%) rename starfish/{ => core}/codebook/test/test_code_length.py (95%) rename starfish/{ => core}/codebook/test/test_from_code_array.py (98%) rename starfish/{ => core}/codebook/test/test_metric_decode.py (96%) rename starfish/{ => core}/codebook/test/test_normalize_code_traces.py (97%) rename starfish/{ => core}/codebook/test/test_per_round_max_decode.py (97%) rename starfish/{ => core}/codebook/test/test_synthetic_one_hot_codebook.py (94%) rename starfish/{ => core}/compat.py (100%) rename starfish/{ => core}/config/__init__.py (96%) rename starfish/{ => core}/config/test/__init__.py (100%) rename starfish/{ => core}/config/test/test_config.py (98%) rename starfish/{ => core}/errors.py (100%) rename starfish/{experiment/builder/test => core/experiment}/__init__.py (100%) rename starfish/{ => core}/experiment/builder/__init__.py (97%) rename starfish/{ => core}/experiment/builder/cli.py (96%) rename starfish/{ => core}/experiment/builder/defaultproviders.py (98%) rename starfish/{ => core}/experiment/builder/inplace.py (100%) rename starfish/{ => core}/experiment/builder/orderediterator.py (97%) rename starfish/{ => core}/experiment/builder/providers.py (97%) rename starfish/{experiment => core/experiment/builder}/test/__init__.py (100%) rename starfish/{ => core}/experiment/builder/test/inplace_script.py (94%) rename starfish/{ => core}/experiment/builder/test/test_build.py (97%) rename starfish/{ => core}/experiment/builder/test/test_inplace.py (88%) rename starfish/{ => core}/experiment/builder/test/test_orderediterator.py (88%) rename starfish/{ => core}/experiment/experiment.py (98%) rename starfish/{expression_matrix => core/experiment/test}/__init__.py (100%) rename starfish/{ => core}/experiment/test/test_experiment.py (97%) rename starfish/{ => core}/experiment/test/test_version.py (77%) rename starfish/{ => core}/experiment/version.py (100%) rename starfish/{expression_matrix/test => core/expression_matrix}/__init__.py (100%) rename starfish/{ => core}/expression_matrix/expression_matrix.py (97%) rename starfish/{image/_filter => core/expression_matrix}/test/__init__.py (100%) rename starfish/{ => core}/expression_matrix/test/test_serialization.py (100%) rename starfish/{ => core}/image/__init__.py (100%) rename starfish/{ => core}/image/_filter/__init__.py (55%) rename starfish/{ => core}/image/_filter/_base.py (77%) rename starfish/{ => core}/image/_filter/bandpass.py (97%) rename starfish/{ => core}/image/_filter/clip.py (97%) rename starfish/{ => core}/image/_filter/element_wise_mult.py (94%) rename starfish/{ => core}/image/_filter/gaussian_high_pass.py (94%) rename starfish/{ => core}/image/_filter/gaussian_low_pass.py (96%) rename starfish/{ => core}/image/_filter/laplace.py (95%) rename starfish/{ => core}/image/_filter/linear_unmixing.py (97%) rename starfish/{ => core}/image/_filter/match_histograms.py (95%) rename starfish/{ => core}/image/_filter/max_proj.py (93%) rename starfish/{ => core}/image/_filter/mean_high_pass.py (96%) rename starfish/{ => core}/image/_filter/richardson_lucy_deconvolution.py (98%) rename starfish/{image/_registration => core/image/_filter/test}/__init__.py (100%) rename starfish/{ => core}/image/_filter/test/test_api_contract.py (97%) rename starfish/{ => core}/image/_filter/test/test_filter.py (88%) rename starfish/{ => core}/image/_filter/test/test_histogram_matching.py (87%) rename starfish/{ => core}/image/_filter/test/test_linear_unmixing.py (92%) rename starfish/{ => core}/image/_filter/test/test_white_tophat.py (96%) rename starfish/{ => core}/image/_filter/test/test_zero_by_channel_magnitude.py (89%) rename starfish/{ => core}/image/_filter/util.py (98%) rename starfish/{ => core}/image/_filter/white_tophat.py (96%) rename starfish/{ => core}/image/_filter/zero_by_channel_magnitude.py (95%) rename starfish/{image/_registration/_apply_transform/test => core/image/_registration}/__init__.py (100%) rename starfish/{ => core}/image/_registration/_apply_transform/__init__.py (58%) rename starfish/{ => core}/image/_registration/_apply_transform/_base.py (81%) rename starfish/{image/_registration/_learn_transform => core/image/_registration/_apply_transform}/test/__init__.py (100%) rename starfish/{ => core}/image/_registration/_apply_transform/test/test_warp.py (90%) rename starfish/{ => core}/image/_registration/_apply_transform/warp.py (89%) rename starfish/{ => core}/image/_registration/_learn_transform/__init__.py (58%) rename starfish/{ => core}/image/_registration/_learn_transform/_base.py (79%) rename starfish/{image/_registration => core/image/_registration/_learn_transform}/test/__init__.py (100%) rename starfish/{ => core}/image/_registration/_learn_transform/test/test_translation.py (91%) rename starfish/{ => core}/image/_registration/_learn_transform/translation.py (92%) rename starfish/{imagestack => core/image/_registration}/test/__init__.py (100%) rename starfish/{ => core}/image/_registration/test/test_transforms_list.py (81%) rename starfish/{ => core}/image/_registration/transforms_list.py (97%) rename starfish/{ => core}/image/_segment/__init__.py (55%) rename starfish/{ => core}/image/_segment/_base.py (80%) rename starfish/{ => core}/image/_segment/watershed.py (97%) rename starfish/{ => core}/imagestack/__init__.py (100%) rename starfish/{ => core}/imagestack/_mp_dataarray.py (99%) rename starfish/{ => core}/imagestack/dataorder.py (91%) rename starfish/{ => core}/imagestack/imagestack.py (96%) rename starfish/{ => core}/imagestack/indexing_utils.py (98%) rename starfish/{ => core}/imagestack/parser/__init__.py (100%) rename starfish/{ => core}/imagestack/parser/_key.py (97%) rename starfish/{ => core}/imagestack/parser/_tiledata.py (96%) rename starfish/{ => core}/imagestack/parser/crop.py (97%) rename starfish/{ => core}/imagestack/parser/numpy/__init__.py (97%) rename starfish/{ => core}/imagestack/parser/tileset/__init__.py (100%) rename starfish/{ => core}/imagestack/parser/tileset/_parser.py (96%) rename starfish/{ => core}/imagestack/physical_coordinate_calculator.py (98%) rename starfish/{intensity_table => core/imagestack/test}/__init__.py (100%) rename starfish/{ => core}/imagestack/test/factories/__init__.py (100%) rename starfish/{ => core}/imagestack/test/factories/from_codebook.py (87%) rename starfish/{ => core}/imagestack/test/factories/synthetic_stack.py (76%) rename starfish/{ => core}/imagestack/test/factories/unique_tiles.py (91%) rename starfish/{ => core}/imagestack/test/factories/with_coords.py (90%) rename starfish/{ => core}/imagestack/test/imagestack_test_utils.py (95%) rename starfish/{ => core}/imagestack/test/test_apply.py (96%) rename starfish/{ => core}/imagestack/test/test_coordinates.py (96%) rename starfish/{ => core}/imagestack/test/test_cropped_load.py (94%) rename starfish/{ => core}/imagestack/test/test_export.py (88%) rename starfish/{ => core}/imagestack/test/test_from_numpy_array.py (93%) rename starfish/{ => core}/imagestack/test/test_index.py (98%) rename starfish/{ => core}/imagestack/test/test_labeled_indices.py (97%) rename starfish/{ => core}/imagestack/test/test_max_proj.py (80%) rename starfish/{ => core}/imagestack/test/test_metadata.py (94%) rename starfish/{ => core}/imagestack/test/test_slice_ops.py (99%) rename starfish/{ => core}/imagestack/test/test_slicedimage_dtype.py (96%) rename starfish/{intensity_table/test => core/intensity_table}/__init__.py (100%) rename starfish/{ => core}/intensity_table/concatenate.py (96%) rename starfish/{ => core}/intensity_table/intensity_table.py (98%) rename starfish/{ => core}/intensity_table/intensity_table_coordinates.py (87%) rename starfish/{ => core}/intensity_table/overlap.py (98%) rename starfish/{multiprocessing => core/intensity_table/test}/__init__.py (100%) rename starfish/{ => core}/intensity_table/test/factories.py (86%) rename starfish/{ => core}/intensity_table/test/test_concatenate.py (96%) rename starfish/{ => core}/intensity_table/test/test_empty_intensity_table.py (92%) rename starfish/{ => core}/intensity_table/test/test_from_imagestack.py (92%) rename starfish/{ => core}/intensity_table/test/test_from_spot_data.py (94%) rename starfish/{ => core}/intensity_table/test/test_intensity_table_coords.py (87%) rename starfish/{ => core}/intensity_table/test/test_intensity_table_serialization.py (90%) rename starfish/{ => core}/intensity_table/test/test_overlap.py (97%) rename starfish/{ => core}/intensity_table/test/test_stack_intensity_table_reshaping.py (90%) rename starfish/{ => core}/intensity_table/test/test_synthetic_intensities.py (90%) rename starfish/{ => core}/intensity_table/test/test_to_mermaid.py (90%) rename starfish/{multiprocessing/test => core/multiprocessing}/__init__.py (100%) rename starfish/{ => core}/multiprocessing/pool.py (100%) rename starfish/{ => core}/multiprocessing/shmem.py (100%) rename starfish/{recipe => core/multiprocessing}/test/__init__.py (100%) rename starfish/{ => core}/multiprocessing/test/test_multiprocessing.py (98%) rename starfish/{ => core}/pipeline/__init__.py (100%) rename starfish/{ => core}/pipeline/algorithmbase.py (93%) rename starfish/{ => core}/pipeline/pipelinecomponent.py (100%) rename starfish/{ => core}/recipe/__init__.py (100%) rename starfish/{ => core}/recipe/cli.py (87%) rename starfish/{ => core}/recipe/errors.py (100%) rename starfish/{ => core}/recipe/filesystem.py (92%) rename starfish/{ => core}/recipe/recipe.py (100%) rename starfish/{ => core}/recipe/runnable.py (99%) rename starfish/{spacetx_format => core/recipe/test}/__init__.py (100%) rename starfish/{ => core}/recipe/test/fakefilter.py (96%) rename starfish/{ => core}/recipe/test/test_recipe.py (97%) rename starfish/{ => core}/recipe/test/test_runnable.py (98%) rename starfish/{ => core}/segmentation_mask.py (99%) rename starfish/{spots/_detect_pixels/test => core/spacetx_format}/__init__.py (100%) rename starfish/{ => core}/spacetx_format/cli.py (99%) rename starfish/{ => core}/spacetx_format/test/test_validate.py (86%) rename starfish/{ => core}/spacetx_format/test_codebook.py (96%) rename starfish/{ => core}/spacetx_format/test_coordinates.py (100%) rename starfish/{ => core}/spacetx_format/test_experiment.py (100%) rename starfish/{ => core}/spacetx_format/test_field_of_view.py (100%) rename starfish/{ => core}/spacetx_format/test_fov_manifest.py (100%) rename starfish/{ => core}/spacetx_format/test_fuzz.py (98%) rename starfish/{ => core}/spacetx_format/util.py (100%) rename starfish/{ => core}/spacetx_format/validate_sptx.py (95%) rename starfish/{ => core}/spots/__init__.py (100%) rename starfish/{ => core}/spots/_assign_targets/__init__.py (57%) rename starfish/{ => core}/spots/_assign_targets/_base.py (85%) rename starfish/{ => core}/spots/_assign_targets/label.py (91%) rename starfish/{ => core}/spots/_decode/__init__.py (55%) rename starfish/{ => core}/spots/_decode/_base.py (85%) rename starfish/{ => core}/spots/_decode/metric_decoder.py (94%) rename starfish/{ => core}/spots/_decode/per_round_max_channel_decoder.py (89%) rename starfish/{ => core}/spots/_detect_pixels/__init__.py (57%) rename starfish/{ => core}/spots/_detect_pixels/_base.py (84%) rename starfish/{ => core}/spots/_detect_pixels/combine_adjacent_features.py (98%) rename starfish/{ => core}/spots/_detect_pixels/pixel_spot_decoder.py (94%) rename starfish/{spots/_detect_spots => core/spots/_detect_pixels}/test/__init__.py (100%) rename starfish/{ => core}/spots/_detect_pixels/test/test_calculate_mean_pixel_traces.py (94%) rename starfish/{ => core}/spots/_detect_pixels/test/test_create_spot_attributes.py (92%) rename starfish/{ => core}/spots/_detect_pixels/test/test_intensities_to_decoded_image.py (95%) rename starfish/{ => core}/spots/_detect_pixels/test/test_targets_map.py (85%) rename starfish/{ => core}/spots/_detect_spots/__init__.py (57%) rename starfish/{ => core}/spots/_detect_spots/_base.py (93%) rename starfish/{ => core}/spots/_detect_spots/blob.py (96%) rename starfish/{ => core}/spots/_detect_spots/detect.py (97%) rename starfish/{ => core}/spots/_detect_spots/local_max_peak_finder.py (97%) rename starfish/{ => core}/spots/_detect_spots/local_search_blob_detector.py (97%) rename starfish/{ => core/spots/_detect_spots}/test/__init__.py (100%) rename starfish/{ => core}/spots/_detect_spots/test/test_local_search_blob_detector.py (97%) rename starfish/{ => core}/spots/_detect_spots/test/test_spot_detection.py (92%) rename starfish/{ => core}/spots/_detect_spots/test/test_synthetic_data.py (95%) rename starfish/{ => core}/spots/_detect_spots/trackpy_local_max_peak_finder.py (97%) rename starfish/{ => core}/starfish.py (91%) rename starfish/{types => core}/test/__init__.py (100%) rename starfish/{ => core}/test/factories.py (98%) rename starfish/{ => core}/test/test_profiler.py (100%) rename starfish/{ => core}/test/test_segmentation_mask.py (95%) rename starfish/{ => core}/test/test_synthetic_spot_creation.py (88%) rename starfish/{ => core}/types/__init__.py (100%) rename starfish/{ => core}/types/_constants.py (100%) rename starfish/{ => core}/types/_decoded_spots.py (93%) rename starfish/{ => core}/types/_spot_attributes.py (97%) rename starfish/{ => core}/types/_validated_table.py (100%) rename starfish/{intensity_table/test/test_to_expression_matrix.py => core/types/test/__init__.py} (100%) rename starfish/{ => core}/types/test/test_decoded_spots.py (89%) create mode 100644 starfish/core/util/__init__.py rename starfish/{ => core}/util/argparse.py (100%) rename starfish/{ => core}/util/click/__init__.py (100%) rename starfish/{ => core}/util/click/indirectparams.py (91%) rename starfish/{ => core}/util/click/test/test_help.py (97%) rename starfish/{ => core}/util/clock.py (100%) rename starfish/{ => core}/util/config.py (100%) rename starfish/{ => core}/util/dtype.py (100%) rename starfish/{ => core}/util/enum.py (80%) rename starfish/{ => core}/util/exec.py (98%) rename starfish/{ => core}/util/indirectfile/__init__.py (100%) rename starfish/{ => core}/util/indirectfile/_base.py (100%) rename starfish/{ => core}/util/indirectfile/_codebook.py (76%) rename starfish/{ => core}/util/indirectfile/_imagestack.py (81%) rename starfish/{ => core}/util/logging.py (89%) rename starfish/{ => core}/util/try_import.py (100%) create mode 100644 starfish/experiment/builder.py create mode 100644 starfish/image.py create mode 100644 starfish/spots.py create mode 100644 starfish/types.py diff --git a/.flake8 b/.flake8 index 33f153e8d..ede827e64 100644 --- a/.flake8 +++ b/.flake8 @@ -1,4 +1,4 @@ [flake8] max-line-length=100 -application-import-names = starfish, examples +application-import-names = starfish import-order-style = smarkets diff --git a/docs/source/_static/data_formatting_examples/format_imc_data.py b/docs/source/_static/data_formatting_examples/format_imc_data.py index 9bb287c56..545ff4e3a 100644 --- a/docs/source/_static/data_formatting_examples/format_imc_data.py +++ b/docs/source/_static/data_formatting_examples/format_imc_data.py @@ -8,13 +8,13 @@ import os from typing import List, Mapping, Tuple, Union +import click import numpy as np from skimage.io import imread from slicedimage import ImageFormat from starfish.experiment.builder import FetchedTile, TileFetcher, write_experiment_json from starfish.types import Axes, Coordinates, Features, Number -from starfish.util import click class ImagingMassCytometryTile(FetchedTile): diff --git a/docs/source/_static/data_formatting_examples/format_osmfish.py b/docs/source/_static/data_formatting_examples/format_osmfish.py index 2dd128f8b..61fcadad5 100644 --- a/docs/source/_static/data_formatting_examples/format_osmfish.py +++ b/docs/source/_static/data_formatting_examples/format_osmfish.py @@ -11,13 +11,13 @@ import re from typing import Mapping, Tuple, Union +import click import numpy as np from slicedimage import ImageFormat import starfish.util.try_import from starfish.experiment.builder import FetchedTile, TileFetcher, write_experiment_json from starfish.types import Axes, Coordinates, Features, Number -from starfish.util import click # We use this to cache images across tiles. In the case of the osmFISH data set, volumes are saved diff --git a/docs/source/_static/data_formatting_examples/format_starmap.py b/docs/source/_static/data_formatting_examples/format_starmap.py index 32c43d6d2..f3edb078a 100644 --- a/docs/source/_static/data_formatting_examples/format_starmap.py +++ b/docs/source/_static/data_formatting_examples/format_starmap.py @@ -11,6 +11,7 @@ import os from typing import Mapping, Tuple, Union +import click import numpy as np from skimage.io import imread from slicedimage import ImageFormat @@ -18,7 +19,6 @@ from starfish import Codebook from starfish.experiment.builder import FetchedTile, TileFetcher, write_experiment_json from starfish.types import Axes, Coordinates, Features -from starfish.util import click # We use this to cache images. This allows us to write a separate function to extract the data's diff --git a/docs/source/api/data_structures/codebook.rst b/docs/source/api/data_structures/codebook.rst index 6172506ec..ad5ea9780 100644 --- a/docs/source/api/data_structures/codebook.rst +++ b/docs/source/api/data_structures/codebook.rst @@ -3,5 +3,5 @@ Codebook ======== -.. automodule:: starfish.codebook.codebook +.. autoclass:: starfish.core.codebook.codebook.Codebook :members: diff --git a/docs/source/api/data_structures/experiment.rst b/docs/source/api/data_structures/experiment.rst index ebf7768cf..64ff4427f 100644 --- a/docs/source/api/data_structures/experiment.rst +++ b/docs/source/api/data_structures/experiment.rst @@ -3,5 +3,5 @@ Experiment ========== -.. autoclass:: starfish.experiment.experiment.Experiment +.. autoclass:: starfish.core.experiment.experiment.Experiment :members: diff --git a/docs/source/api/data_structures/expression_matrix.rst b/docs/source/api/data_structures/expression_matrix.rst index 088fd54a2..d28994287 100644 --- a/docs/source/api/data_structures/expression_matrix.rst +++ b/docs/source/api/data_structures/expression_matrix.rst @@ -7,5 +7,5 @@ Expression Matrix is a wrapper for xarray.DataArray that provides serialization loom, and AnnData to enable it to be used with single-cell analysis software packages such as scanpy (python) and seurat (R). -.. automodule:: starfish.expression_matrix.expression_matrix +.. autoclass:: starfish.core.expression_matrix.expression_matrix.ExpressionMatrix :members: diff --git a/docs/source/api/data_structures/field_of_view.rst b/docs/source/api/data_structures/field_of_view.rst index 9916e9757..bdb478f9c 100644 --- a/docs/source/api/data_structures/field_of_view.rst +++ b/docs/source/api/data_structures/field_of_view.rst @@ -3,5 +3,5 @@ Field of View ============= -.. autoclass:: starfish.experiment.experiment.FieldOfView +.. autoclass:: starfish.core.experiment.experiment.FieldOfView :members: diff --git a/docs/source/api/data_structures/image_stack.rst b/docs/source/api/data_structures/image_stack.rst index f4f331df0..9ffe93c11 100644 --- a/docs/source/api/data_structures/image_stack.rst +++ b/docs/source/api/data_structures/image_stack.rst @@ -3,5 +3,5 @@ ImageStack ========== -.. automodule:: starfish.imagestack.imagestack +.. autoclass:: starfish.core.imagestack.imagestack.ImageStack :members: diff --git a/docs/source/api/data_structures/intensity_table.rst b/docs/source/api/data_structures/intensity_table.rst index b3a8133c4..3ecdea9f6 100644 --- a/docs/source/api/data_structures/intensity_table.rst +++ b/docs/source/api/data_structures/intensity_table.rst @@ -3,8 +3,8 @@ IntensityTable ============== -.. automodule:: starfish.intensity_table.intensity_table +.. autoclass:: starfish.core.intensity_table.intensity_table.IntensityTable :members: -.. automodule:: starfish.intensity_table.intensity_table_coordinates +.. automodule:: starfish.core.intensity_table.intensity_table_coordinates :members: diff --git a/docs/source/api/data_structures/pipeline_component.rst b/docs/source/api/data_structures/pipeline_component.rst index 84c523077..93fbb5672 100644 --- a/docs/source/api/data_structures/pipeline_component.rst +++ b/docs/source/api/data_structures/pipeline_component.rst @@ -3,5 +3,5 @@ Pipeline Component ================== -.. automodule:: starfish.pipeline.pipelinecomponent +.. automodule:: starfish.core.pipeline.pipelinecomponent :members: diff --git a/docs/source/api/recipe/index.rst b/docs/source/api/recipe/index.rst index 34c95c351..6ea3a8cbc 100644 --- a/docs/source/api/recipe/index.rst +++ b/docs/source/api/recipe/index.rst @@ -3,5 +3,5 @@ Recipe ====== -.. autoclass:: starfish.recipe.Recipe +.. autoclass:: starfish.core.recipe.Recipe :members: diff --git a/docs/source/api/types/index.rst b/docs/source/api/types/index.rst index c556de78b..92e1cf4ea 100644 --- a/docs/source/api/types/index.rst +++ b/docs/source/api/types/index.rst @@ -16,13 +16,13 @@ Coordinates holds constants that store with the physical coordinates of a field a field of view's relative location to some global scale parameter, and identify how to stitch or combine multiple fields of view. -.. autoclass:: starfish.types.Coordinates +.. autoclass:: starfish.core.types.Coordinates :members: :undoc-members: Physical Coordinates --------------------- -.. autoclass:: starfish.types.PhysicalCoordinateTypes +.. autoclass:: starfish.core.types.PhysicalCoordinateTypes :members: :undoc-members: @@ -36,7 +36,7 @@ Axes holds constants that represent indexers into the dimensions of the :py:clas 2. :py:class:`Codebook`, which stores expected image intensities across imaging rounds and channels -.. autoclass:: starfish.types.Axes +.. autoclass:: starfish.core.types.Axes :members: :undoc-members: @@ -46,7 +46,7 @@ Features Features holds constants that represent characteristics of detected image features (most often spots, but sometimes also individual pixels). -.. autoclass:: starfish.types.Features +.. autoclass:: starfish.core.types.Features :members: :undoc-members: @@ -58,13 +58,13 @@ SpotAttributes defines the minimum amount of information required by starfish to a spot. It also contains methods to save these attributes to files that can be used to visualize detected spots. -.. autoclass:: starfish.types.SpotAttributes +.. autoclass:: starfish.core.types.SpotAttributes :members: Clip _____ -.. autoclass:: starfish.types.Clip +.. autoclass:: starfish.core.types.Clip :members: :undoc-members: diff --git a/docs/source/api/validation/index.rst b/docs/source/api/validation/index.rst index 45be7ae14..9a91ea808 100644 --- a/docs/source/api/validation/index.rst +++ b/docs/source/api/validation/index.rst @@ -8,7 +8,7 @@ Validators are provided for validating a SpaceTx fileset against the :ref:`schem Validators ---------- -.. autoclass:: starfish.spacetx_format.util.SpaceTxValidator +.. autoclass:: starfish.core.spacetx_format.util.SpaceTxValidator :members: :exclude-members: fuzz_object @@ -19,7 +19,7 @@ In addition, the starfish.spacetx_format.validate_sptx module contains helpers t iterating over the tree of json files and their respective schemas. -.. automodule:: starfish.spacetx_format.validate_sptx +.. automodule:: starfish.core.spacetx_format.validate_sptx :members: @@ -31,7 +31,7 @@ For example: :: - starfish/starfish/spacetx_format/util.py:82: UserWarning: + starfish/starfish/core/spacetx_format/util.py:82: UserWarning: 'contents' is a required property Schema: https://github.com/spacetx/starfish/starfish/file-format/schema/fov-manifest.json Subschema level: 0 diff --git a/docs/source/getting_started/formatting_data/index.rst b/docs/source/getting_started/formatting_data/index.rst index 9cbafdd53..fde236b57 100644 --- a/docs/source/getting_started/formatting_data/index.rst +++ b/docs/source/getting_started/formatting_data/index.rst @@ -110,10 +110,10 @@ SpaceTx-Format :py:class:`Experiment`. These are the abstract classes that must be subclassed for each set of naming conventions: -.. literalinclude:: /../../starfish/experiment/builder/providers.py +.. literalinclude:: /../../starfish/core/experiment/builder/providers.py :pyobject: FetchedTile -.. literalinclude:: /../../starfish/experiment/builder/providers.py +.. literalinclude:: /../../starfish/core/experiment/builder/providers.py :pyobject: TileFetcher To create a formatter object for in-situ sequencing, we subclass the ``TileFetcher`` and diff --git a/notebooks/ISS.ipynb b/notebooks/ISS.ipynb index c7bb6a51a..176ef3249 100644 --- a/notebooks/ISS.ipynb +++ b/notebooks/ISS.ipynb @@ -356,7 +356,7 @@ "outputs": [], "source": [ "from starfish.spots import AssignTargets\n", - "from starfish.expression_matrix.expression_matrix import ExpressionMatrix\n", + "from starfish import ExpressionMatrix\n", "\n", "al = AssignTargets.Label()\n", "labeled = al.run(masks, decoded)\n", diff --git a/notebooks/STARmap.ipynb b/notebooks/STARmap.ipynb index d2ea238ba..5a9cdeee2 100644 --- a/notebooks/STARmap.ipynb +++ b/notebooks/STARmap.ipynb @@ -58,8 +58,7 @@ "rounds. Ideally, these should form fairly coherent spots, indicating that the\n", "data are well registered. By contrast, if there are patterns whereby pairs of\n", "spots are consistently present at small shifts, that can indicate systematic\n", - "registration offsets which should be corrected prior to analysis.\n", - "" + "registration offsets which should be corrected prior to analysis." ] }, { @@ -92,8 +91,7 @@ "----------------------\n", "The STARmap codebook maps pixel intensities across the rounds and channels to\n", "the corresponding barcodes and genes that those pixels code for. For this\n", - "dataset, the codebook specifies 160 gene targets.\n", - "" + "dataset, the codebook specifies 160 gene targets." ] }, { @@ -185,8 +183,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Show the effect of registration.\n", - "" + "Show the effect of registration." ] }, { @@ -234,8 +231,7 @@ "Note that this type of histogram matching has an implied assumption that each\n", "channel has relatively similar numbers of spots. In the case of this data\n", "this assumption is reasonably accurate, but for other datasets it can be\n", - "problematic to apply filters that match this stringently.\n", - "" + "problematic to apply filters that match this stringently." ] }, { @@ -294,8 +290,7 @@ "zero. Note that many of the spots do _not_ identify spots in other rounds and\n", "channels and will therefore fail decoding. Because of the stringency built\n", "into the STARmap codebook, it is OK to be relatively permissive with the spot\n", - "finding parameters for this assay.\n", - "" + "finding parameters for this assay." ] }, { @@ -324,8 +319,7 @@ "------------\n", "Next, spots are decoded. There is really no good way to display 3-d spot\n", "detection in 2-d planes, so we encourage you to grab this notebook and\n", - "uncomment the below lines.\n", - "" + "uncomment the below lines." ] }, { diff --git a/notebooks/py/ISS.py b/notebooks/py/ISS.py index 918d10378..2f73c8fb8 100644 --- a/notebooks/py/ISS.py +++ b/notebooks/py/ISS.py @@ -232,7 +232,7 @@ # EPY: START code from starfish.spots import AssignTargets -from starfish.expression_matrix.expression_matrix import ExpressionMatrix +from starfish import ExpressionMatrix al = AssignTargets.Label() labeled = al.run(masks, decoded) diff --git a/setup.py b/setup.py index 04320bbf1..a8d6b9ff3 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ }, entry_points={ 'console_scripts': [ - "starfish=starfish.starfish:starfish", + "starfish=starfish:starfish", ] }, include_package_data=True, diff --git a/starfish/__init__.py b/starfish/__init__.py index abbb9c5b0..f841dec19 100644 --- a/starfish/__init__.py +++ b/starfish/__init__.py @@ -1,37 +1,26 @@ -# deal with numpy import warnings due to cython -# See: https://stackoverflow.com/questions/40845304/ -# runtimewarning-numpy-dtype-size-changed-may-indicate-binary-incompatibility) -import warnings -warnings.filterwarnings("ignore", message="numpy.dtype size changed") # noqa -warnings.filterwarnings("ignore", message="numpy.ufunc size changed") # noqa - -import pkg_resources - -# image processing methods and objects -from . import image -# spot detection and manipulation -from . import spots +from . import ( + # configuration management. + config, + # image processing methods and objects. + image, + # spot detection and manipulation. + spots, +) +from .core import ( + is_release_tag as __is_release_tag__, + version as __version__ +) # display images and spots -from ._display import display -# generated version number and commit hash -from ._version import get_versions +from .core._display import display # top-level objects -from .codebook.codebook import Codebook -from .experiment.experiment import Experiment, FieldOfView -from .imagestack.imagestack import ImageStack -from .intensity_table.intensity_table import IntensityTable -from .recipe import cli -from .starfish import starfish +from .core.codebook.codebook import Codebook +from .core.experiment.experiment import Experiment, FieldOfView +from .core.expression_matrix.expression_matrix import ExpressionMatrix +from .core.imagestack.imagestack import ImageStack +from .core.intensity_table.intensity_table import IntensityTable +from .core.recipe import cli +from .core.starfish import starfish -# NOTE: if we move to python 3.7, we can produce this value at call time via __getattr__ -__version__ = get_versions()['version'] -__is_release_tag__ = None -if "+" not in str(__version__): - __is_release_tag__ = f"Release: {__version__}" -del get_versions - if __name__ == "__main__": starfish() - -del warnings, pkg_resources diff --git a/starfish/__main__.py b/starfish/__main__.py deleted file mode 100644 index 87bfd4e08..000000000 --- a/starfish/__main__.py +++ /dev/null @@ -1,3 +0,0 @@ -from .starfish import starfish - -starfish() diff --git a/starfish/config.py b/starfish/config.py new file mode 100644 index 000000000..8fd37ba40 --- /dev/null +++ b/starfish/config.py @@ -0,0 +1 @@ +from .core.config import environ, StarfishConfig # noqa: F401 diff --git a/starfish/core/__init__.py b/starfish/core/__init__.py new file mode 100644 index 000000000..cb94dfc86 --- /dev/null +++ b/starfish/core/__init__.py @@ -0,0 +1,16 @@ +# deal with numpy import warnings due to cython +# See: https://stackoverflow.com/questions/40845304/ +# runtimewarning-numpy-dtype-size-changed-may-indicate-binary-incompatibility) +import warnings +warnings.filterwarnings("ignore", message="numpy.dtype size changed") # noqa +warnings.filterwarnings("ignore", message="numpy.ufunc size changed") # noqa + +# generated version number and commit hash +from ._version import get_versions + + +# NOTE: if we move to python 3.7, we can produce this value at call time via __getattr__ +version = get_versions()['version'] +is_release_tag = None +if "+" not in str(version): + is_release_tag = f"Release: {version}" diff --git a/starfish/_display.py b/starfish/core/_display.py similarity index 98% rename from starfish/_display.py rename to starfish/core/_display.py index 497de8c06..d9ee17796 100644 --- a/starfish/_display.py +++ b/starfish/core/_display.py @@ -5,9 +5,9 @@ import numpy as np -from starfish.imagestack.imagestack import ImageStack -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.types import Axes, Features +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.types import Axes, Features try: with warnings.catch_warnings(): diff --git a/starfish/_version.py b/starfish/core/_version.py similarity index 100% rename from starfish/_version.py rename to starfish/core/_version.py diff --git a/starfish/codebook/__init__.py b/starfish/core/codebook/__init__.py similarity index 100% rename from starfish/codebook/__init__.py rename to starfish/core/codebook/__init__.py diff --git a/starfish/codebook/_format.py b/starfish/core/codebook/_format.py similarity index 100% rename from starfish/codebook/_format.py rename to starfish/core/codebook/_format.py diff --git a/starfish/codebook/codebook.py b/starfish/core/codebook/codebook.py similarity index 98% rename from starfish/codebook/codebook.py rename to starfish/core/codebook/codebook.py index cf290f616..39ef556dc 100644 --- a/starfish/codebook/codebook.py +++ b/starfish/core/codebook/codebook.py @@ -9,17 +9,17 @@ from sklearn.neighbors import NearestNeighbors from slicedimage.io import resolve_path_or_url -from starfish.codebook._format import ( +from starfish.core.codebook._format import ( CURRENT_VERSION, DocumentKeys, MAX_SUPPORTED_VERSION, MIN_SUPPORTED_VERSION, ) -from starfish.config import StarfishConfig -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.spacetx_format.util import SpaceTxValidator -from starfish.spacetx_format.validate_sptx import _get_absolute_schema_path -from starfish.types import Axes, Features, Number +from starfish.core.config import StarfishConfig +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.spacetx_format.util import SpaceTxValidator +from starfish.core.spacetx_format.validate_sptx import _get_absolute_schema_path +from starfish.core.types import Axes, Features, Number class Codebook(xr.DataArray): @@ -199,7 +199,7 @@ def from_code_array( Construct a codebook from some array data in python memory :: - >>> from starfish.types import Axes + >>> from starfish.core.types import Axes >>> from starfish import Codebook >>> codebook = [ >>> { @@ -312,7 +312,7 @@ def open_json( Create a codebook from in-memory data :: - >>> from starfish.types import Axes + >>> from starfish.core.types import Axes >>> from starfish import Codebook >>> import tempfile >>> import json diff --git a/starfish/codebook/test/__init__.py b/starfish/core/codebook/test/__init__.py similarity index 100% rename from starfish/codebook/test/__init__.py rename to starfish/core/codebook/test/__init__.py diff --git a/starfish/codebook/test/factories.py b/starfish/core/codebook/test/factories.py similarity index 95% rename from starfish/codebook/test/factories.py rename to starfish/core/codebook/test/factories.py index 17e8b5da9..d03c7af12 100644 --- a/starfish/codebook/test/factories.py +++ b/starfish/core/codebook/test/factories.py @@ -1,7 +1,7 @@ import tempfile -from starfish.codebook.codebook import Codebook -from starfish.types import Axes, Features +from starfish.core.types import Axes, Features +from ..codebook import Codebook def simple_codebook_array(): diff --git a/starfish/codebook/test/test_approximate_nearest_code.py b/starfish/core/codebook/test/test_approximate_nearest_code.py similarity index 100% rename from starfish/codebook/test/test_approximate_nearest_code.py rename to starfish/core/codebook/test/test_approximate_nearest_code.py diff --git a/starfish/codebook/test/test_code_length.py b/starfish/core/codebook/test/test_code_length.py similarity index 95% rename from starfish/codebook/test/test_code_length.py rename to starfish/core/codebook/test/test_code_length.py index 438616526..dfc54ee00 100644 --- a/starfish/codebook/test/test_code_length.py +++ b/starfish/core/codebook/test/test_code_length.py @@ -2,8 +2,8 @@ Tests for codebook.code_length method """ -from starfish import Codebook from .test_from_code_array import codebook_array_factory +from ..codebook import Codebook def test_code_length_properly_counts_bit_length_of_codes(): diff --git a/starfish/codebook/test/test_from_code_array.py b/starfish/core/codebook/test/test_from_code_array.py similarity index 98% rename from starfish/codebook/test/test_from_code_array.py rename to starfish/core/codebook/test/test_from_code_array.py index b81fa687a..428306e50 100644 --- a/starfish/codebook/test/test_from_code_array.py +++ b/starfish/core/codebook/test/test_from_code_array.py @@ -7,8 +7,8 @@ import numpy as np import pytest -from starfish import Codebook -from starfish.types import Axes, Features +from starfish.core.types import Axes, Features +from ..codebook import Codebook def codebook_array_factory() -> List[Dict[str, Any]]: diff --git a/starfish/codebook/test/test_metric_decode.py b/starfish/core/codebook/test/test_metric_decode.py similarity index 96% rename from starfish/codebook/test/test_metric_decode.py rename to starfish/core/codebook/test/test_metric_decode.py index cb6bca17d..4cce13746 100644 --- a/starfish/codebook/test/test_metric_decode.py +++ b/starfish/core/codebook/test/test_metric_decode.py @@ -6,8 +6,9 @@ import pandas as pd import pytest -from starfish import Codebook, IntensityTable -from starfish.types import Axes, Features, SpotAttributes +from starfish import IntensityTable +from starfish.core.types import Axes, Features, SpotAttributes +from ..codebook import Codebook def intensity_table_factory(data: np.ndarray=np.array([[[0, 3], [4, 0]]])) -> IntensityTable: diff --git a/starfish/codebook/test/test_normalize_code_traces.py b/starfish/core/codebook/test/test_normalize_code_traces.py similarity index 97% rename from starfish/codebook/test/test_normalize_code_traces.py rename to starfish/core/codebook/test/test_normalize_code_traces.py index 44db58c64..c12a443d6 100644 --- a/starfish/codebook/test/test_normalize_code_traces.py +++ b/starfish/core/codebook/test/test_normalize_code_traces.py @@ -2,8 +2,9 @@ import pandas as pd import pytest -from starfish import Codebook, IntensityTable -from starfish.types import Axes, Features, SpotAttributes +from starfish import IntensityTable +from starfish.core.types import Axes, Features, SpotAttributes +from ..codebook import Codebook def intensity_table_factory() -> IntensityTable: diff --git a/starfish/codebook/test/test_per_round_max_decode.py b/starfish/core/codebook/test/test_per_round_max_decode.py similarity index 97% rename from starfish/codebook/test/test_per_round_max_decode.py rename to starfish/core/codebook/test/test_per_round_max_decode.py index 4424950ca..6280cf98d 100644 --- a/starfish/codebook/test/test_per_round_max_decode.py +++ b/starfish/core/codebook/test/test_per_round_max_decode.py @@ -6,8 +6,9 @@ import pandas as pd import pytest -from starfish import Codebook, IntensityTable -from starfish.types import Axes, Features, SpotAttributes +from starfish import IntensityTable +from starfish.core.types import Axes, Features, SpotAttributes +from ..codebook import Codebook def intensity_table_factory(data: np.ndarray=np.array([[[0, 3], [4, 0]]])) -> IntensityTable: diff --git a/starfish/codebook/test/test_synthetic_one_hot_codebook.py b/starfish/core/codebook/test/test_synthetic_one_hot_codebook.py similarity index 94% rename from starfish/codebook/test/test_synthetic_one_hot_codebook.py rename to starfish/core/codebook/test/test_synthetic_one_hot_codebook.py index 4b98457fd..3835452a2 100644 --- a/starfish/codebook/test/test_synthetic_one_hot_codebook.py +++ b/starfish/core/codebook/test/test_synthetic_one_hot_codebook.py @@ -5,8 +5,8 @@ import numpy as np import pytest -from starfish import Codebook -from starfish.types import Axes, Features +from starfish.core.types import Axes, Features +from ..codebook import Codebook def test_synthetic_one_hot_codebook_returns_requested_codebook(): diff --git a/starfish/compat.py b/starfish/core/compat.py similarity index 100% rename from starfish/compat.py rename to starfish/core/compat.py diff --git a/starfish/config/__init__.py b/starfish/core/config/__init__.py similarity index 96% rename from starfish/config/__init__.py rename to starfish/core/config/__init__.py index c3167771b..633ba43f1 100644 --- a/starfish/config/__init__.py +++ b/starfish/core/config/__init__.py @@ -1,7 +1,7 @@ import os import warnings -from starfish.util.config import Config, NestedDict +from starfish.core.util.config import Config, NestedDict def special_prefix(key): @@ -23,8 +23,8 @@ class environ(object): -------- Turn on validation: - >>> from starfish.config import environ - >>> from starfish.experiment.experiment import Experiment + >>> from starfish.core.config import environ + >>> from starfish.core.experiment.experiment import Experiment >>> with environ(VALIDATION_STRICT="true"): >>> Experiment.from_json(URL) @@ -71,7 +71,7 @@ class StarfishConfig(object): -------- Check strict property - >>> from starfish.config import StarfishConfig + >>> from starfish.core.config import StarfishConfig >>> config = StarfishConfig() >>> if config.strict: >>> validate(json) diff --git a/starfish/config/test/__init__.py b/starfish/core/config/test/__init__.py similarity index 100% rename from starfish/config/test/__init__.py rename to starfish/core/config/test/__init__.py diff --git a/starfish/config/test/test_config.py b/starfish/core/config/test/test_config.py similarity index 98% rename from starfish/config/test/test_config.py rename to starfish/core/config/test/test_config.py index 4701d0db7..a42276f2a 100644 --- a/starfish/config/test/test_config.py +++ b/starfish/core/config/test/test_config.py @@ -6,8 +6,8 @@ from pytest import mark, raises from starfish import data -from starfish.config import environ, StarfishConfig -from starfish.util.config import Config, NestedDict +from starfish.core.util.config import Config, NestedDict +from .. import environ, StarfishConfig def test_nested_dict(): diff --git a/starfish/errors.py b/starfish/core/errors.py similarity index 100% rename from starfish/errors.py rename to starfish/core/errors.py diff --git a/starfish/experiment/builder/test/__init__.py b/starfish/core/experiment/__init__.py similarity index 100% rename from starfish/experiment/builder/test/__init__.py rename to starfish/core/experiment/__init__.py diff --git a/starfish/experiment/builder/__init__.py b/starfish/core/experiment/builder/__init__.py similarity index 97% rename from starfish/experiment/builder/__init__.py rename to starfish/core/experiment/builder/__init__.py index 50462267b..551fe1a3e 100644 --- a/starfish/experiment/builder/__init__.py +++ b/starfish/core/experiment/builder/__init__.py @@ -20,10 +20,10 @@ Writer, ) -from starfish.codebook.codebook import Codebook -from starfish.experiment.builder.orderediterator import join_axes_labels, ordered_iterator -from starfish.experiment.version import CURRENT_VERSION -from starfish.types import Axes, Coordinates +from starfish.core.codebook.codebook import Codebook +from starfish.core.experiment.builder.orderediterator import join_axes_labels, ordered_iterator +from starfish.core.experiment.version import CURRENT_VERSION +from starfish.core.types import Axes, Coordinates from .defaultproviders import RandomNoiseTile, tile_fetcher_factory from .providers import FetchedTile, TileFetcher diff --git a/starfish/experiment/builder/cli.py b/starfish/core/experiment/builder/cli.py similarity index 96% rename from starfish/experiment/builder/cli.py rename to starfish/core/experiment/builder/cli.py index 27df4f112..e93023a0f 100644 --- a/starfish/experiment/builder/cli.py +++ b/starfish/core/experiment/builder/cli.py @@ -2,8 +2,8 @@ from slicedimage import ImageFormat -from starfish.types import Axes -from starfish.util import click +from starfish.core.types import Axes +from starfish.core.util import click from . import AUX_IMAGE_NAMES, write_experiment_json diff --git a/starfish/experiment/builder/defaultproviders.py b/starfish/core/experiment/builder/defaultproviders.py similarity index 98% rename from starfish/experiment/builder/defaultproviders.py rename to starfish/core/experiment/builder/defaultproviders.py index c54ba46fd..7b59cd169 100644 --- a/starfish/experiment/builder/defaultproviders.py +++ b/starfish/core/experiment/builder/defaultproviders.py @@ -9,7 +9,7 @@ ImageFormat, ) -from starfish.types import Axes, Coordinates, Number +from starfish.core.types import Axes, Coordinates, Number from .providers import FetchedTile, TileFetcher diff --git a/starfish/experiment/builder/inplace.py b/starfish/core/experiment/builder/inplace.py similarity index 100% rename from starfish/experiment/builder/inplace.py rename to starfish/core/experiment/builder/inplace.py diff --git a/starfish/experiment/builder/orderediterator.py b/starfish/core/experiment/builder/orderediterator.py similarity index 97% rename from starfish/experiment/builder/orderediterator.py rename to starfish/core/experiment/builder/orderediterator.py index f6b5432bb..c9f61ea81 100644 --- a/starfish/experiment/builder/orderediterator.py +++ b/starfish/core/experiment/builder/orderediterator.py @@ -1,7 +1,7 @@ from itertools import product from typing import Iterator, Mapping, Sequence, Tuple -from starfish.types import Axes +from starfish.core.types import Axes def join_axes_labels( diff --git a/starfish/experiment/builder/providers.py b/starfish/core/experiment/builder/providers.py similarity index 97% rename from starfish/experiment/builder/providers.py rename to starfish/core/experiment/builder/providers.py index 73bf8b639..7c19dc741 100644 --- a/starfish/experiment/builder/providers.py +++ b/starfish/core/experiment/builder/providers.py @@ -6,7 +6,7 @@ import numpy as np -from starfish.types import Axes, Coordinates, Number +from starfish.core.types import Axes, Coordinates, Number class FetchedTile: diff --git a/starfish/experiment/test/__init__.py b/starfish/core/experiment/builder/test/__init__.py similarity index 100% rename from starfish/experiment/test/__init__.py rename to starfish/core/experiment/builder/test/__init__.py diff --git a/starfish/experiment/builder/test/inplace_script.py b/starfish/core/experiment/builder/test/inplace_script.py similarity index 94% rename from starfish/experiment/builder/test/inplace_script.py rename to starfish/core/experiment/builder/test/inplace_script.py index fb5108d79..6831685c7 100644 --- a/starfish/experiment/builder/test/inplace_script.py +++ b/starfish/core/experiment/builder/test/inplace_script.py @@ -8,12 +8,12 @@ from skimage.io import imread, imsave from slicedimage import ImageFormat -from starfish.experiment.builder import FetchedTile, TileFetcher, write_experiment_json -from starfish.experiment.builder.inplace import ( +from starfish.core.experiment.builder import FetchedTile, TileFetcher, write_experiment_json +from starfish.core.experiment.builder.inplace import ( enable_inplace_mode, inplace_tile_opener, InplaceFetchedTile ) -from starfish.experiment.experiment import Experiment, FieldOfView -from starfish.types import Axes, Coordinates, Number +from starfish.core.experiment.experiment import Experiment, FieldOfView +from starfish.core.types import Axes, Coordinates, Number SHAPE = {Axes.Y: 500, Axes.X: 1390} diff --git a/starfish/experiment/builder/test/test_build.py b/starfish/core/experiment/builder/test/test_build.py similarity index 97% rename from starfish/experiment/builder/test/test_build.py rename to starfish/core/experiment/builder/test/test_build.py index e04cf737c..b32b9c8a7 100644 --- a/starfish/experiment/builder/test/test_build.py +++ b/starfish/core/experiment/builder/test/test_build.py @@ -1,7 +1,7 @@ import os import unittest -from starfish.util import exec +from starfish.core.util import exec class TestWithBuildData(unittest.TestCase): diff --git a/starfish/experiment/builder/test/test_inplace.py b/starfish/core/experiment/builder/test/test_inplace.py similarity index 88% rename from starfish/experiment/builder/test/test_inplace.py rename to starfish/core/experiment/builder/test/test_inplace.py index fa022ef4b..dac1c18c8 100644 --- a/starfish/experiment/builder/test/test_inplace.py +++ b/starfish/core/experiment/builder/test/test_inplace.py @@ -4,7 +4,7 @@ import tempfile from pathlib import Path -from starfish.experiment.experiment import Experiment +from starfish.core.experiment.experiment import Experiment def test_inplace(): diff --git a/starfish/experiment/builder/test/test_orderediterator.py b/starfish/core/experiment/builder/test/test_orderediterator.py similarity index 88% rename from starfish/experiment/builder/test/test_orderediterator.py rename to starfish/core/experiment/builder/test/test_orderediterator.py index 0bef3b3f4..4d7661e29 100644 --- a/starfish/experiment/builder/test/test_orderediterator.py +++ b/starfish/core/experiment/builder/test/test_orderediterator.py @@ -1,5 +1,5 @@ -from starfish.experiment.builder.orderediterator import ordered_iterator -from starfish.types import Axes +from starfish.core.experiment.builder.orderediterator import ordered_iterator +from starfish.core.types import Axes def test_round_then_ch(): diff --git a/starfish/experiment/experiment.py b/starfish/core/experiment/experiment.py similarity index 98% rename from starfish/experiment/experiment.py rename to starfish/core/experiment/experiment.py index ea9378468..8ce72d5f4 100644 --- a/starfish/experiment/experiment.py +++ b/starfish/core/experiment/experiment.py @@ -20,11 +20,11 @@ from slicedimage.io import Reader, resolve_path_or_url, resolve_url from slicedimage.urlpath import pathjoin -from starfish.codebook.codebook import Codebook -from starfish.config import StarfishConfig -from starfish.imagestack.imagestack import ImageStack -from starfish.imagestack.parser.crop import CropParameters -from starfish.spacetx_format import validate_sptx +from starfish.core.codebook.codebook import Codebook +from starfish.core.config import StarfishConfig +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.imagestack.parser.crop import CropParameters +from starfish.core.spacetx_format import validate_sptx from .version import MAX_SUPPORTED_VERSION, MIN_SUPPORTED_VERSION diff --git a/starfish/expression_matrix/__init__.py b/starfish/core/experiment/test/__init__.py similarity index 100% rename from starfish/expression_matrix/__init__.py rename to starfish/core/experiment/test/__init__.py diff --git a/starfish/experiment/test/test_experiment.py b/starfish/core/experiment/test/test_experiment.py similarity index 97% rename from starfish/experiment/test/test_experiment.py rename to starfish/core/experiment/test/test_experiment.py index 4f0dc4ea1..08f354648 100644 --- a/starfish/experiment/test/test_experiment.py +++ b/starfish/core/experiment/test/test_experiment.py @@ -4,9 +4,9 @@ from slicedimage import Tile, TileSet import starfish.data -from starfish.experiment.experiment import Experiment, FieldOfView -from starfish.test.factories import SyntheticData +from starfish.core.test.factories import SyntheticData from starfish.types import Axes, Coordinates +from ..experiment import Experiment, FieldOfView def round_to_x(r: int) -> Tuple[float, float]: diff --git a/starfish/experiment/test/test_version.py b/starfish/core/experiment/test/test_version.py similarity index 77% rename from starfish/experiment/test/test_version.py rename to starfish/core/experiment/test/test_version.py index 13f276210..54fc18443 100644 --- a/starfish/experiment/test/test_version.py +++ b/starfish/core/experiment/test/test_version.py @@ -1,7 +1,7 @@ import pytest -from starfish.experiment.experiment import Experiment -from starfish.experiment.version import MAX_SUPPORTED_VERSION, MIN_SUPPORTED_VERSION +from ..experiment import Experiment +from ..version import MAX_SUPPORTED_VERSION, MIN_SUPPORTED_VERSION def test_min_version(): diff --git a/starfish/experiment/version.py b/starfish/core/experiment/version.py similarity index 100% rename from starfish/experiment/version.py rename to starfish/core/experiment/version.py diff --git a/starfish/expression_matrix/test/__init__.py b/starfish/core/expression_matrix/__init__.py similarity index 100% rename from starfish/expression_matrix/test/__init__.py rename to starfish/core/expression_matrix/__init__.py diff --git a/starfish/expression_matrix/expression_matrix.py b/starfish/core/expression_matrix/expression_matrix.py similarity index 97% rename from starfish/expression_matrix/expression_matrix.py rename to starfish/core/expression_matrix/expression_matrix.py index 33aea46e1..3f7194ef9 100644 --- a/starfish/expression_matrix/expression_matrix.py +++ b/starfish/core/expression_matrix/expression_matrix.py @@ -1,6 +1,6 @@ import xarray as xr -from starfish.util.try_import import try_import +from starfish.core.util.try_import import try_import class ExpressionMatrix(xr.DataArray): diff --git a/starfish/image/_filter/test/__init__.py b/starfish/core/expression_matrix/test/__init__.py similarity index 100% rename from starfish/image/_filter/test/__init__.py rename to starfish/core/expression_matrix/test/__init__.py diff --git a/starfish/expression_matrix/test/test_serialization.py b/starfish/core/expression_matrix/test/test_serialization.py similarity index 100% rename from starfish/expression_matrix/test/test_serialization.py rename to starfish/core/expression_matrix/test/test_serialization.py diff --git a/starfish/image/__init__.py b/starfish/core/image/__init__.py similarity index 100% rename from starfish/image/__init__.py rename to starfish/core/image/__init__.py diff --git a/starfish/image/_filter/__init__.py b/starfish/core/image/_filter/__init__.py similarity index 55% rename from starfish/image/_filter/__init__.py rename to starfish/core/image/_filter/__init__.py index 1eccbe0ba..da0e306a2 100644 --- a/starfish/image/_filter/__init__.py +++ b/starfish/core/image/_filter/__init__.py @@ -1,3 +1,3 @@ -from starfish.pipeline import import_all_submodules +from starfish.core.pipeline import import_all_submodules from ._base import Filter import_all_submodules(__file__, __package__) diff --git a/starfish/image/_filter/_base.py b/starfish/core/image/_filter/_base.py similarity index 77% rename from starfish/image/_filter/_base.py rename to starfish/core/image/_filter/_base.py index 22f49489d..1f24aba3a 100644 --- a/starfish/image/_filter/_base.py +++ b/starfish/core/image/_filter/_base.py @@ -1,11 +1,11 @@ from abc import abstractmethod from typing import Type -from starfish.imagestack.imagestack import ImageStack -from starfish.pipeline.algorithmbase import AlgorithmBase -from starfish.pipeline.pipelinecomponent import PipelineComponent -from starfish.util import click -from starfish.util.click.indirectparams import ImageStackParamType +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.pipeline.algorithmbase import AlgorithmBase +from starfish.core.pipeline.pipelinecomponent import PipelineComponent +from starfish.core.util import click +from starfish.core.util.click.indirectparams import ImageStackParamType class Filter(PipelineComponent): diff --git a/starfish/image/_filter/bandpass.py b/starfish/core/image/_filter/bandpass.py similarity index 97% rename from starfish/image/_filter/bandpass.py rename to starfish/core/image/_filter/bandpass.py index 5781d01bd..91af06d1d 100644 --- a/starfish/image/_filter/bandpass.py +++ b/starfish/core/image/_filter/bandpass.py @@ -5,9 +5,9 @@ import xarray as xr from trackpy import bandpass -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Clip, Number -from starfish.util import click +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Clip, Number +from starfish.core.util import click from ._base import FilterAlgorithmBase from .util import determine_axes_to_group_by diff --git a/starfish/image/_filter/clip.py b/starfish/core/image/_filter/clip.py similarity index 97% rename from starfish/image/_filter/clip.py rename to starfish/core/image/_filter/clip.py index 100bd2477..1d4f0a26b 100644 --- a/starfish/image/_filter/clip.py +++ b/starfish/core/image/_filter/clip.py @@ -4,8 +4,8 @@ import numpy as np import xarray as xr -from starfish.imagestack.imagestack import ImageStack -from starfish.util import click +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.util import click from ._base import FilterAlgorithmBase from .util import determine_axes_to_group_by diff --git a/starfish/image/_filter/element_wise_mult.py b/starfish/core/image/_filter/element_wise_mult.py similarity index 94% rename from starfish/image/_filter/element_wise_mult.py rename to starfish/core/image/_filter/element_wise_mult.py index 4f3a81588..a27057ec7 100644 --- a/starfish/image/_filter/element_wise_mult.py +++ b/starfish/core/image/_filter/element_wise_mult.py @@ -4,10 +4,10 @@ import numpy as np import xarray as xr -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Clip -from starfish.util import click -from starfish.util.dtype import preserve_float_range +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Clip +from starfish.core.util import click +from starfish.core.util.dtype import preserve_float_range from ._base import FilterAlgorithmBase diff --git a/starfish/image/_filter/gaussian_high_pass.py b/starfish/core/image/_filter/gaussian_high_pass.py similarity index 94% rename from starfish/image/_filter/gaussian_high_pass.py rename to starfish/core/image/_filter/gaussian_high_pass.py index c2307eb45..416609f0c 100644 --- a/starfish/image/_filter/gaussian_high_pass.py +++ b/starfish/core/image/_filter/gaussian_high_pass.py @@ -4,11 +4,11 @@ import numpy as np import xarray as xr -from starfish.image._filter.gaussian_low_pass import GaussianLowPass -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Clip, Number -from starfish.util import click -from starfish.util.dtype import preserve_float_range +from starfish.core.image._filter.gaussian_low_pass import GaussianLowPass +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Clip, Number +from starfish.core.util import click +from starfish.core.util.dtype import preserve_float_range from ._base import FilterAlgorithmBase from .util import ( determine_axes_to_group_by, diff --git a/starfish/image/_filter/gaussian_low_pass.py b/starfish/core/image/_filter/gaussian_low_pass.py similarity index 96% rename from starfish/image/_filter/gaussian_low_pass.py rename to starfish/core/image/_filter/gaussian_low_pass.py index db835336a..a24b77d65 100644 --- a/starfish/image/_filter/gaussian_low_pass.py +++ b/starfish/core/image/_filter/gaussian_low_pass.py @@ -5,10 +5,10 @@ import xarray as xr from skimage.filters import gaussian -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Clip, Number -from starfish.util import click -from starfish.util.dtype import preserve_float_range +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Clip, Number +from starfish.core.util import click +from starfish.core.util.dtype import preserve_float_range from ._base import FilterAlgorithmBase from .util import ( determine_axes_to_group_by, diff --git a/starfish/image/_filter/laplace.py b/starfish/core/image/_filter/laplace.py similarity index 95% rename from starfish/image/_filter/laplace.py rename to starfish/core/image/_filter/laplace.py index 3595e3144..6bcbbfc76 100644 --- a/starfish/image/_filter/laplace.py +++ b/starfish/core/image/_filter/laplace.py @@ -6,14 +6,14 @@ import xarray as xr from scipy.ndimage import gaussian_laplace -from starfish.image._filter._base import FilterAlgorithmBase -from starfish.image._filter.util import ( +from starfish.core.image._filter._base import FilterAlgorithmBase +from starfish.core.image._filter.util import ( determine_axes_to_group_by, validate_and_broadcast_kernel_size, ) -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Clip, Number -from starfish.util import click +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Clip, Number +from starfish.core.util import click class Laplace(FilterAlgorithmBase): diff --git a/starfish/image/_filter/linear_unmixing.py b/starfish/core/image/_filter/linear_unmixing.py similarity index 97% rename from starfish/image/_filter/linear_unmixing.py rename to starfish/core/image/_filter/linear_unmixing.py index cca40bdcf..180592cb5 100644 --- a/starfish/image/_filter/linear_unmixing.py +++ b/starfish/core/image/_filter/linear_unmixing.py @@ -4,9 +4,9 @@ import numpy as np import xarray as xr -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Axes, Clip -from starfish.util import click +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Axes, Clip +from starfish.core.util import click from ._base import FilterAlgorithmBase diff --git a/starfish/image/_filter/match_histograms.py b/starfish/core/image/_filter/match_histograms.py similarity index 95% rename from starfish/image/_filter/match_histograms.py rename to starfish/core/image/_filter/match_histograms.py index f3fc70b38..f0f1d1a2b 100644 --- a/starfish/image/_filter/match_histograms.py +++ b/starfish/core/image/_filter/match_histograms.py @@ -4,10 +4,10 @@ import numpy as np import xarray as xr -from starfish.compat import match_histograms -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Axes -from starfish.util import click, enum +from starfish.core.compat import match_histograms +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Axes +from starfish.core.util import click, enum from ._base import FilterAlgorithmBase diff --git a/starfish/image/_filter/max_proj.py b/starfish/core/image/_filter/max_proj.py similarity index 93% rename from starfish/image/_filter/max_proj.py rename to starfish/core/image/_filter/max_proj.py index d71f7d4b9..ee88f6c33 100644 --- a/starfish/image/_filter/max_proj.py +++ b/starfish/core/image/_filter/max_proj.py @@ -1,8 +1,8 @@ from typing import Iterable, Optional, Union -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Axes -from starfish.util import click +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Axes +from starfish.core.util import click from ._base import FilterAlgorithmBase diff --git a/starfish/image/_filter/mean_high_pass.py b/starfish/core/image/_filter/mean_high_pass.py similarity index 96% rename from starfish/image/_filter/mean_high_pass.py rename to starfish/core/image/_filter/mean_high_pass.py index 5dbfd5712..08c947440 100644 --- a/starfish/image/_filter/mean_high_pass.py +++ b/starfish/core/image/_filter/mean_high_pass.py @@ -5,10 +5,10 @@ import xarray as xr from scipy.ndimage.filters import uniform_filter -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Clip, Number -from starfish.util import click -from starfish.util.dtype import preserve_float_range +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Clip, Number +from starfish.core.util import click +from starfish.core.util.dtype import preserve_float_range from ._base import FilterAlgorithmBase from .util import ( determine_axes_to_group_by, validate_and_broadcast_kernel_size diff --git a/starfish/image/_filter/richardson_lucy_deconvolution.py b/starfish/core/image/_filter/richardson_lucy_deconvolution.py similarity index 98% rename from starfish/image/_filter/richardson_lucy_deconvolution.py rename to starfish/core/image/_filter/richardson_lucy_deconvolution.py index 77d92cb7e..cf448c009 100644 --- a/starfish/image/_filter/richardson_lucy_deconvolution.py +++ b/starfish/core/image/_filter/richardson_lucy_deconvolution.py @@ -5,9 +5,9 @@ import xarray as xr from scipy.signal import convolve, fftconvolve -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Clip, Number -from starfish.util import click +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Clip, Number +from starfish.core.util import click from ._base import FilterAlgorithmBase from .util import ( determine_axes_to_group_by, diff --git a/starfish/image/_registration/__init__.py b/starfish/core/image/_filter/test/__init__.py similarity index 100% rename from starfish/image/_registration/__init__.py rename to starfish/core/image/_filter/test/__init__.py diff --git a/starfish/image/_filter/test/test_api_contract.py b/starfish/core/image/_filter/test/test_api_contract.py similarity index 97% rename from starfish/image/_filter/test/test_api_contract.py rename to starfish/core/image/_filter/test/test_api_contract.py index c646d2897..3824450e0 100644 --- a/starfish/image/_filter/test/test_api_contract.py +++ b/starfish/core/image/_filter/test/test_api_contract.py @@ -23,8 +23,8 @@ import pytest from starfish import ImageStack -from starfish.image import Filter -from starfish.image._filter.max_proj import MaxProject +from starfish.core.image import Filter +from starfish.core.image._filter.max_proj import MaxProject methods: Mapping[str, Type] = Filter._algorithm_to_class_map() diff --git a/starfish/image/_filter/test/test_filter.py b/starfish/core/image/_filter/test/test_filter.py similarity index 88% rename from starfish/image/_filter/test/test_filter.py rename to starfish/core/image/_filter/test/test_filter.py index 6ccde7e58..0394ec845 100644 --- a/starfish/image/_filter/test/test_filter.py +++ b/starfish/core/image/_filter/test/test_filter.py @@ -3,9 +3,9 @@ import numpy as np import pytest -from starfish.image._filter import gaussian_high_pass, mean_high_pass -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Clip, Number +from starfish.core.image._filter import gaussian_high_pass, mean_high_pass +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Clip, Number def random_data_image_stack_factory(): diff --git a/starfish/image/_filter/test/test_histogram_matching.py b/starfish/core/image/_filter/test/test_histogram_matching.py similarity index 87% rename from starfish/image/_filter/test/test_histogram_matching.py rename to starfish/core/image/_filter/test/test_histogram_matching.py index bff81943d..813a54cc1 100644 --- a/starfish/image/_filter/test/test_histogram_matching.py +++ b/starfish/core/image/_filter/test/test_histogram_matching.py @@ -1,8 +1,8 @@ import numpy as np -from starfish.image._filter.match_histograms import MatchHistograms -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Axes +from starfish.core.image._filter.match_histograms import MatchHistograms +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Axes def test_match_histograms(): diff --git a/starfish/image/_filter/test/test_linear_unmixing.py b/starfish/core/image/_filter/test/test_linear_unmixing.py similarity index 92% rename from starfish/image/_filter/test/test_linear_unmixing.py rename to starfish/core/image/_filter/test/test_linear_unmixing.py index 8e4643682..70b5c5666 100644 --- a/starfish/image/_filter/test/test_linear_unmixing.py +++ b/starfish/core/image/_filter/test/test_linear_unmixing.py @@ -1,8 +1,8 @@ import numpy as np from starfish import ImageStack -from starfish.image._filter.linear_unmixing import LinearUnmixing -from starfish.types import Clip +from starfish.core.image._filter.linear_unmixing import LinearUnmixing +from starfish.core.types import Clip def setup_linear_unmixing_test(): """ diff --git a/starfish/image/_filter/test/test_white_tophat.py b/starfish/core/image/_filter/test/test_white_tophat.py similarity index 96% rename from starfish/image/_filter/test/test_white_tophat.py rename to starfish/core/image/_filter/test/test_white_tophat.py index ae882a013..665387d6a 100644 --- a/starfish/image/_filter/test/test_white_tophat.py +++ b/starfish/core/image/_filter/test/test_white_tophat.py @@ -2,7 +2,7 @@ import pytest from skimage.filters import gaussian -from starfish.image._filter.white_tophat import WhiteTophat +from starfish.core.image._filter.white_tophat import WhiteTophat def simple_spot_3d(): diff --git a/starfish/image/_filter/test/test_zero_by_channel_magnitude.py b/starfish/core/image/_filter/test/test_zero_by_channel_magnitude.py similarity index 89% rename from starfish/image/_filter/test/test_zero_by_channel_magnitude.py rename to starfish/core/image/_filter/test/test_zero_by_channel_magnitude.py index 197feb02a..c5745b99b 100644 --- a/starfish/image/_filter/test/test_zero_by_channel_magnitude.py +++ b/starfish/core/image/_filter/test/test_zero_by_channel_magnitude.py @@ -1,7 +1,7 @@ import numpy as np from starfish import ImageStack -from starfish.image._filter.zero_by_channel_magnitude import ZeroByChannelMagnitude +from starfish.core.image._filter.zero_by_channel_magnitude import ZeroByChannelMagnitude def create_imagestack_with_magnitude_scale(): """create an imagestack with increasing magnitudes""" diff --git a/starfish/image/_filter/util.py b/starfish/core/image/_filter/util.py similarity index 98% rename from starfish/image/_filter/util.py rename to starfish/core/image/_filter/util.py index c4b72cd6e..51a366d0c 100644 --- a/starfish/image/_filter/util.py +++ b/starfish/core/image/_filter/util.py @@ -3,7 +3,7 @@ import numpy as np from skimage.morphology import binary_opening, disk -from starfish.types import Axes, Number +from starfish.core.types import Axes, Number def bin_thresh(img: np.ndarray, thresh: Number) -> np.ndarray: diff --git a/starfish/image/_filter/white_tophat.py b/starfish/core/image/_filter/white_tophat.py similarity index 96% rename from starfish/image/_filter/white_tophat.py rename to starfish/core/image/_filter/white_tophat.py index 1a1e98385..674800d70 100644 --- a/starfish/image/_filter/white_tophat.py +++ b/starfish/core/image/_filter/white_tophat.py @@ -4,9 +4,9 @@ import xarray as xr from skimage.morphology import ball, disk, white_tophat -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Clip -from starfish.util import click +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Clip +from starfish.core.util import click from ._base import FilterAlgorithmBase from .util import determine_axes_to_group_by diff --git a/starfish/image/_filter/zero_by_channel_magnitude.py b/starfish/core/image/_filter/zero_by_channel_magnitude.py similarity index 95% rename from starfish/image/_filter/zero_by_channel_magnitude.py rename to starfish/core/image/_filter/zero_by_channel_magnitude.py index f426e79b6..74c8d2b20 100644 --- a/starfish/image/_filter/zero_by_channel_magnitude.py +++ b/starfish/core/image/_filter/zero_by_channel_magnitude.py @@ -4,10 +4,10 @@ import numpy as np from tqdm import tqdm -from starfish.config import StarfishConfig -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Axes -from starfish.util import click +from starfish.core.config import StarfishConfig +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Axes +from starfish.core.util import click from ._base import FilterAlgorithmBase diff --git a/starfish/image/_registration/_apply_transform/test/__init__.py b/starfish/core/image/_registration/__init__.py similarity index 100% rename from starfish/image/_registration/_apply_transform/test/__init__.py rename to starfish/core/image/_registration/__init__.py diff --git a/starfish/image/_registration/_apply_transform/__init__.py b/starfish/core/image/_registration/_apply_transform/__init__.py similarity index 58% rename from starfish/image/_registration/_apply_transform/__init__.py rename to starfish/core/image/_registration/_apply_transform/__init__.py index 98922b8c0..db6186683 100644 --- a/starfish/image/_registration/_apply_transform/__init__.py +++ b/starfish/core/image/_registration/_apply_transform/__init__.py @@ -1,3 +1,3 @@ -from starfish.pipeline import import_all_submodules +from starfish.core.pipeline import import_all_submodules from ._base import ApplyTransform import_all_submodules(__file__, __package__) diff --git a/starfish/image/_registration/_apply_transform/_base.py b/starfish/core/image/_registration/_apply_transform/_base.py similarity index 81% rename from starfish/image/_registration/_apply_transform/_base.py rename to starfish/core/image/_registration/_apply_transform/_base.py index 9d7036ac6..b2f9e91b2 100644 --- a/starfish/image/_registration/_apply_transform/_base.py +++ b/starfish/core/image/_registration/_apply_transform/_base.py @@ -1,12 +1,12 @@ from abc import abstractmethod from typing import Type -from starfish.image._registration.transforms_list import TransformsList -from starfish.imagestack.imagestack import ImageStack -from starfish.pipeline import PipelineComponent -from starfish.pipeline.algorithmbase import AlgorithmBase -from starfish.util import click -from starfish.util.click.indirectparams import ImageStackParamType +from starfish.core.image._registration.transforms_list import TransformsList +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.pipeline import PipelineComponent +from starfish.core.pipeline.algorithmbase import AlgorithmBase +from starfish.core.util import click +from starfish.core.util.click.indirectparams import ImageStackParamType class ApplyTransform(PipelineComponent): diff --git a/starfish/image/_registration/_learn_transform/test/__init__.py b/starfish/core/image/_registration/_apply_transform/test/__init__.py similarity index 100% rename from starfish/image/_registration/_learn_transform/test/__init__.py rename to starfish/core/image/_registration/_apply_transform/test/__init__.py diff --git a/starfish/image/_registration/_apply_transform/test/test_warp.py b/starfish/core/image/_registration/_apply_transform/test/test_warp.py similarity index 90% rename from starfish/image/_registration/_apply_transform/test/test_warp.py rename to starfish/core/image/_registration/_apply_transform/test/test_warp.py index 2add75309..03ec80aa2 100644 --- a/starfish/image/_registration/_apply_transform/test/test_warp.py +++ b/starfish/core/image/_registration/_apply_transform/test/test_warp.py @@ -1,9 +1,9 @@ import numpy as np from starfish import data -from starfish.image._registration._apply_transform.warp import Warp -from starfish.image._registration._learn_transform.translation import Translation -from starfish.types import Axes +from starfish.core.image._registration._apply_transform.warp import Warp +from starfish.core.image._registration._learn_transform.translation import Translation +from starfish.core.types import Axes expected_registered_values = np.array( diff --git a/starfish/image/_registration/_apply_transform/warp.py b/starfish/core/image/_registration/_apply_transform/warp.py similarity index 89% rename from starfish/image/_registration/_apply_transform/warp.py rename to starfish/core/image/_registration/_apply_transform/warp.py index 0356afa6d..61272298d 100644 --- a/starfish/image/_registration/_apply_transform/warp.py +++ b/starfish/core/image/_registration/_apply_transform/warp.py @@ -7,12 +7,12 @@ from skimage.transform._geometric import GeometricTransform from tqdm import tqdm -from starfish.config import StarfishConfig -from starfish.image._registration._apply_transform._base import ApplyTransformBase -from starfish.image._registration.transforms_list import TransformsList -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Axes -from starfish.util import click +from starfish.core.config import StarfishConfig +from starfish.core.image._registration._apply_transform._base import ApplyTransformBase +from starfish.core.image._registration.transforms_list import TransformsList +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Axes +from starfish.core.util import click class Warp(ApplyTransformBase): diff --git a/starfish/image/_registration/_learn_transform/__init__.py b/starfish/core/image/_registration/_learn_transform/__init__.py similarity index 58% rename from starfish/image/_registration/_learn_transform/__init__.py rename to starfish/core/image/_registration/_learn_transform/__init__.py index 48e938552..6a83151a4 100644 --- a/starfish/image/_registration/_learn_transform/__init__.py +++ b/starfish/core/image/_registration/_learn_transform/__init__.py @@ -1,3 +1,3 @@ -from starfish.pipeline import import_all_submodules +from starfish.core.pipeline import import_all_submodules from ._base import LearnTransform import_all_submodules(__file__, __package__) diff --git a/starfish/image/_registration/_learn_transform/_base.py b/starfish/core/image/_registration/_learn_transform/_base.py similarity index 79% rename from starfish/image/_registration/_learn_transform/_base.py rename to starfish/core/image/_registration/_learn_transform/_base.py index 8f0a3bead..ed31c771b 100644 --- a/starfish/image/_registration/_learn_transform/_base.py +++ b/starfish/core/image/_registration/_learn_transform/_base.py @@ -2,11 +2,11 @@ from typing import Type -from starfish.image._registration.transforms_list import TransformsList -from starfish.pipeline.algorithmbase import AlgorithmBase -from starfish.pipeline.pipelinecomponent import PipelineComponent -from starfish.util import click -from starfish.util.click.indirectparams import ImageStackParamType +from starfish.core.image._registration.transforms_list import TransformsList +from starfish.core.pipeline.algorithmbase import AlgorithmBase +from starfish.core.pipeline.pipelinecomponent import PipelineComponent +from starfish.core.util import click +from starfish.core.util.click.indirectparams import ImageStackParamType class LearnTransform(PipelineComponent): diff --git a/starfish/image/_registration/test/__init__.py b/starfish/core/image/_registration/_learn_transform/test/__init__.py similarity index 100% rename from starfish/image/_registration/test/__init__.py rename to starfish/core/image/_registration/_learn_transform/test/__init__.py diff --git a/starfish/image/_registration/_learn_transform/test/test_translation.py b/starfish/core/image/_registration/_learn_transform/test/test_translation.py similarity index 91% rename from starfish/image/_registration/_learn_transform/test/test_translation.py rename to starfish/core/image/_registration/_learn_transform/test/test_translation.py index 7549e89d0..bb11840cb 100644 --- a/starfish/image/_registration/_learn_transform/test/test_translation.py +++ b/starfish/core/image/_registration/_learn_transform/test/test_translation.py @@ -1,8 +1,8 @@ import numpy as np from starfish import data -from starfish.image._registration._learn_transform.translation import Translation -from starfish.types import Axes +from starfish.core.image._registration._learn_transform.translation import Translation +from starfish.core.types import Axes ISS_SHIFTS = [[-23, 6], [-22, 2], [-22, -3], [-15, -4]] diff --git a/starfish/image/_registration/_learn_transform/translation.py b/starfish/core/image/_registration/_learn_transform/translation.py similarity index 92% rename from starfish/image/_registration/_learn_transform/translation.py rename to starfish/core/image/_registration/_learn_transform/translation.py index b3ed872d8..a8a921fa7 100644 --- a/starfish/image/_registration/_learn_transform/translation.py +++ b/starfish/core/image/_registration/_learn_transform/translation.py @@ -2,11 +2,11 @@ from skimage.feature import register_translation from skimage.transform._geometric import SimilarityTransform -from starfish.image._registration.transforms_list import TransformsList -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Axes, TransformType -from starfish.util import click -from starfish.util.click.indirectparams import ImageStackParamType +from starfish.core.image._registration.transforms_list import TransformsList +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Axes, TransformType +from starfish.core.util import click +from starfish.core.util.click.indirectparams import ImageStackParamType from ._base import LearnTransformBase diff --git a/starfish/imagestack/test/__init__.py b/starfish/core/image/_registration/test/__init__.py similarity index 100% rename from starfish/imagestack/test/__init__.py rename to starfish/core/image/_registration/test/__init__.py diff --git a/starfish/image/_registration/test/test_transforms_list.py b/starfish/core/image/_registration/test/test_transforms_list.py similarity index 81% rename from starfish/image/_registration/test/test_transforms_list.py rename to starfish/core/image/_registration/test/test_transforms_list.py index 3bb3c0f6f..318a7d591 100644 --- a/starfish/image/_registration/test/test_transforms_list.py +++ b/starfish/core/image/_registration/test/test_transforms_list.py @@ -3,9 +3,9 @@ import numpy as np from starfish import data -from starfish.image._registration._learn_transform.translation import Translation -from starfish.image._registration.transforms_list import TransformsList -from starfish.types import Axes, TransformType +from starfish.core.image._registration._learn_transform.translation import Translation +from starfish.core.image._registration.transforms_list import TransformsList +from starfish.core.types import Axes, TransformType ISS_SHIFTS = [[-23, 6], [-22, 2], [-22, -3], [-15, -4]] diff --git a/starfish/image/_registration/transforms_list.py b/starfish/core/image/_registration/transforms_list.py similarity index 97% rename from starfish/image/_registration/transforms_list.py rename to starfish/core/image/_registration/transforms_list.py index 10b1eeeaf..d9f01f20e 100644 --- a/starfish/image/_registration/transforms_list.py +++ b/starfish/core/image/_registration/transforms_list.py @@ -5,8 +5,8 @@ from skimage.transform._geometric import GeometricTransform, SimilarityTransform from slicedimage.io import resolve_path_or_url -from starfish.config import StarfishConfig -from starfish.types import Axes, TransformType +from starfish.core.config import StarfishConfig +from starfish.core.types import Axes, TransformType transformsTypeMapping = { diff --git a/starfish/image/_segment/__init__.py b/starfish/core/image/_segment/__init__.py similarity index 55% rename from starfish/image/_segment/__init__.py rename to starfish/core/image/_segment/__init__.py index b765d1af6..e6cc1ce05 100644 --- a/starfish/image/_segment/__init__.py +++ b/starfish/core/image/_segment/__init__.py @@ -1,3 +1,3 @@ -from starfish.pipeline import import_all_submodules +from starfish.core.pipeline import import_all_submodules from ._base import Segment import_all_submodules(__file__, __package__) diff --git a/starfish/image/_segment/_base.py b/starfish/core/image/_segment/_base.py similarity index 80% rename from starfish/image/_segment/_base.py rename to starfish/core/image/_segment/_base.py index cd3075182..075cb68c1 100644 --- a/starfish/image/_segment/_base.py +++ b/starfish/core/image/_segment/_base.py @@ -1,12 +1,12 @@ from abc import abstractmethod from typing import Type -from starfish.imagestack.imagestack import ImageStack -from starfish.pipeline import PipelineComponent -from starfish.pipeline.algorithmbase import AlgorithmBase -from starfish.segmentation_mask import SegmentationMaskCollection -from starfish.util import click -from starfish.util.click.indirectparams import ImageStackParamType +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.pipeline import PipelineComponent +from starfish.core.pipeline.algorithmbase import AlgorithmBase +from starfish.core.segmentation_mask import SegmentationMaskCollection +from starfish.core.util import click +from starfish.core.util.click.indirectparams import ImageStackParamType class Segment(PipelineComponent): diff --git a/starfish/image/_segment/watershed.py b/starfish/core/image/_segment/watershed.py similarity index 97% rename from starfish/image/_segment/watershed.py rename to starfish/core/image/_segment/watershed.py index 599d8d3ed..ac7654f4a 100644 --- a/starfish/image/_segment/watershed.py +++ b/starfish/core/image/_segment/watershed.py @@ -7,11 +7,11 @@ from skimage.feature import peak_local_max from skimage.morphology import watershed -from starfish.image._filter.util import bin_open, bin_thresh -from starfish.imagestack.imagestack import ImageStack -from starfish.segmentation_mask import SegmentationMaskCollection -from starfish.types import Axes, Coordinates, Number -from starfish.util import click +from starfish.core.image._filter.util import bin_open, bin_thresh +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.segmentation_mask import SegmentationMaskCollection +from starfish.core.types import Axes, Coordinates, Number +from starfish.core.util import click from ._base import SegmentAlgorithmBase diff --git a/starfish/imagestack/__init__.py b/starfish/core/imagestack/__init__.py similarity index 100% rename from starfish/imagestack/__init__.py rename to starfish/core/imagestack/__init__.py diff --git a/starfish/imagestack/_mp_dataarray.py b/starfish/core/imagestack/_mp_dataarray.py similarity index 99% rename from starfish/imagestack/_mp_dataarray.py rename to starfish/core/imagestack/_mp_dataarray.py index 521aac9c5..ca96275bb 100644 --- a/starfish/imagestack/_mp_dataarray.py +++ b/starfish/core/imagestack/_mp_dataarray.py @@ -8,7 +8,7 @@ import xarray as xr from xarray import Variable -from starfish.types import Number +from starfish.core.types import Number class MPDataArray: diff --git a/starfish/imagestack/dataorder.py b/starfish/core/imagestack/dataorder.py similarity index 91% rename from starfish/imagestack/dataorder.py rename to starfish/core/imagestack/dataorder.py index 1612bcfd7..84eebd5e8 100644 --- a/starfish/imagestack/dataorder.py +++ b/starfish/core/imagestack/dataorder.py @@ -1,7 +1,7 @@ import collections from typing import Mapping -from starfish.types import Axes +from starfish.core.types import Axes _DimensionMetadata = collections.namedtuple("_DimensionMetadata", ['order', 'required']) diff --git a/starfish/imagestack/imagestack.py b/starfish/core/imagestack/imagestack.py similarity index 96% rename from starfish/imagestack/imagestack.py rename to starfish/core/imagestack/imagestack.py index f56862ff9..39158e5ec 100644 --- a/starfish/imagestack/imagestack.py +++ b/starfish/core/imagestack/imagestack.py @@ -35,16 +35,16 @@ from slicedimage.io import resolve_path_or_url from tqdm import tqdm -from starfish.config import StarfishConfig -from starfish.errors import DataFormatWarning -from starfish.imagestack import indexing_utils, physical_coordinate_calculator -from starfish.imagestack.parser import TileCollectionData, TileKey -from starfish.imagestack.parser.crop import CropParameters, CroppedTileCollectionData -from starfish.imagestack.parser.numpy import NumpyData -from starfish.imagestack.parser.tileset import TileSetData -from starfish.multiprocessing.pool import Pool -from starfish.multiprocessing.shmem import SharedMemory -from starfish.types import ( +from starfish.core.config import StarfishConfig +from starfish.core.errors import DataFormatWarning +from starfish.core.imagestack import indexing_utils, physical_coordinate_calculator +from starfish.core.imagestack.parser import TileCollectionData, TileKey +from starfish.core.imagestack.parser.crop import CropParameters, CroppedTileCollectionData +from starfish.core.imagestack.parser.numpy import NumpyData +from starfish.core.imagestack.parser.tileset import TileSetData +from starfish.core.multiprocessing.pool import Pool +from starfish.core.multiprocessing.shmem import SharedMemory +from starfish.core.types import ( Axes, Clip, Coordinates, @@ -52,8 +52,8 @@ Number, STARFISH_EXTRAS_KEY ) -from starfish.util import logging -from starfish.util.dtype import preserve_float_range +from starfish.core.util import logging +from starfish.core.util.dtype import preserve_float_range from ._mp_dataarray import MPDataArray from .dataorder import AXES_DATA, N_AXES @@ -363,8 +363,8 @@ def sel(self, indexers: Mapping[Axes, Union[int, tuple]]): Create an Imagestack :py:func:`~starfish.imagestack.imagestack.ImageStack.synthetic_stack` >>> from starfish import ImageStack - >>> from starfish.imagestack.test.factories import synthetic_stack - >>> from starfish.types import Axes + >>> from starfish.core.imagestack.test.factories import synthetic_stack + >>> from starfish.core.types import Axes >>> stack = synthetic_stack(5, 5, 15, 200, 200) >>> stack @@ -400,7 +400,7 @@ def isel(self, indexers: Mapping[Axes, Union[int, tuple]]): Create an Imagestack using the ``synthetic_stack`` method >>> from starfish import ImageStack - >>> from starfish.types import Axes + >>> from starfish.core.types import Axes >>> stack = ImageStack.synthetic_stack(5, 5, 15, 200, 200) >>> stack @@ -456,8 +456,8 @@ def get_slice( Slicing with a scalar >>> from starfish import ImageStack - >>> from starfish.imagestack.test.factories import synthetic_stack - >>> from starfish.types import Axes + >>> from starfish.core.imagestack.test.factories import synthetic_stack + >>> from starfish.core.types import Axes >>> stack = synthetic_stack(3, 4, 5, 20, 10) >>> stack.shape OrderedDict([(, 3), @@ -479,8 +479,8 @@ def get_slice( Slicing with a range >>> from starfish import ImageStack - >>> from starfish.imagestack.test.factories import synthetic_stack - >>> from starfish.types import Axes + >>> from starfish.core.imagestack.test.factories import synthetic_stack + >>> from starfish.core.types import Axes >>> stack = synthetic_stack(3, 4, 5, 20, 10) >>> stack.shape OrderedDict([(, 3), @@ -548,8 +548,8 @@ def set_slice( >>> import numpy as np >>> from starfish import ImageStack - >>> from starfish.imagestack.test.factories import synthetic_stack - >>> from starfish.types import Axes + >>> from starfish.core.imagestack.test.factories import synthetic_stack + >>> from starfish.core.types import Axes >>> stack = synthetic_stack(3, 4, 5, 20, 10) >>> stack.shape OrderedDict([(, 3), @@ -565,8 +565,8 @@ def set_slice( >>> import numpy as np >>> from starfish import ImageStack - >>> from starfish.imagestack.test.factories import synthetic_stack - >>> from starfish.types import Axes + >>> from starfish.core.imagestack.test.factories import synthetic_stack + >>> from starfish.core.types import Axes >>> stack = synthetic_stack(3, 4, 5, 20, 10) >>> stack.shape OrderedDict([(, 3), @@ -580,8 +580,8 @@ def set_slice( Setting a slice indicated by a range. >>> from starfish import ImageStack - >>> from starfish.imagestack.test.factories import synthetic_stack - >>> from starfish.types import Axes + >>> from starfish.core.imagestack.test.factories import synthetic_stack + >>> from starfish.core.types import Axes >>> stack = synthetic_stack(3, 4, 5, 20, 10) >>> stack.shape OrderedDict([(, 3), diff --git a/starfish/imagestack/indexing_utils.py b/starfish/core/imagestack/indexing_utils.py similarity index 98% rename from starfish/imagestack/indexing_utils.py rename to starfish/core/imagestack/indexing_utils.py index 9cc3a8ba2..a1b156b9a 100644 --- a/starfish/imagestack/indexing_utils.py +++ b/starfish/core/imagestack/indexing_utils.py @@ -4,7 +4,7 @@ import xarray as xr from xarray.core.utils import is_scalar -from starfish.types import Axes, Coordinates, Number +from starfish.core.types import Axes, Coordinates, Number def convert_to_selector( diff --git a/starfish/imagestack/parser/__init__.py b/starfish/core/imagestack/parser/__init__.py similarity index 100% rename from starfish/imagestack/parser/__init__.py rename to starfish/core/imagestack/parser/__init__.py diff --git a/starfish/imagestack/parser/_key.py b/starfish/core/imagestack/parser/_key.py similarity index 97% rename from starfish/imagestack/parser/_key.py rename to starfish/core/imagestack/parser/_key.py index 076cf5907..8edd9278f 100644 --- a/starfish/imagestack/parser/_key.py +++ b/starfish/core/imagestack/parser/_key.py @@ -1,6 +1,6 @@ import typing -from starfish.types import Axes +from starfish.core.types import Axes class TileKey: diff --git a/starfish/imagestack/parser/_tiledata.py b/starfish/core/imagestack/parser/_tiledata.py similarity index 96% rename from starfish/imagestack/parser/_tiledata.py rename to starfish/core/imagestack/parser/_tiledata.py index 02d8aafe2..e68183bb4 100644 --- a/starfish/imagestack/parser/_tiledata.py +++ b/starfish/core/imagestack/parser/_tiledata.py @@ -2,7 +2,7 @@ import numpy as np -from starfish.types import Axes, Coordinates, Number +from starfish.core.types import Axes, Coordinates, Number from ._key import TileKey diff --git a/starfish/imagestack/parser/crop.py b/starfish/core/imagestack/parser/crop.py similarity index 97% rename from starfish/imagestack/parser/crop.py rename to starfish/core/imagestack/parser/crop.py index 79c69aa7e..292c48a5b 100644 --- a/starfish/imagestack/parser/crop.py +++ b/starfish/core/imagestack/parser/crop.py @@ -4,9 +4,11 @@ import numpy as np from slicedimage import TileSet -from starfish.imagestack.parser import TileCollectionData, TileData, TileKey -from starfish.imagestack.physical_coordinate_calculator import recalculate_physical_coordinate_range -from starfish.types import Axes, Coordinates, Number +from starfish.core.imagestack.parser import TileCollectionData, TileData, TileKey +from starfish.core.imagestack.physical_coordinate_calculator import ( + recalculate_physical_coordinate_range, +) +from starfish.core.types import Axes, Coordinates, Number class CropParameters: diff --git a/starfish/imagestack/parser/numpy/__init__.py b/starfish/core/imagestack/parser/numpy/__init__.py similarity index 97% rename from starfish/imagestack/parser/numpy/__init__.py rename to starfish/core/imagestack/parser/numpy/__init__.py index 200d6373c..44f68c522 100644 --- a/starfish/imagestack/parser/numpy/__init__.py +++ b/starfish/core/imagestack/parser/numpy/__init__.py @@ -16,8 +16,8 @@ import numpy as np import xarray as xr -from starfish.imagestack.parser import TileCollectionData, TileData, TileKey -from starfish.types import ( +from starfish.core.imagestack.parser import TileCollectionData, TileData, TileKey +from starfish.core.types import ( Axes, Coordinates, Number, diff --git a/starfish/imagestack/parser/tileset/__init__.py b/starfish/core/imagestack/parser/tileset/__init__.py similarity index 100% rename from starfish/imagestack/parser/tileset/__init__.py rename to starfish/core/imagestack/parser/tileset/__init__.py diff --git a/starfish/imagestack/parser/tileset/_parser.py b/starfish/core/imagestack/parser/tileset/_parser.py similarity index 96% rename from starfish/imagestack/parser/tileset/_parser.py rename to starfish/core/imagestack/parser/tileset/_parser.py index a8a9f62f5..960a5eb51 100644 --- a/starfish/imagestack/parser/tileset/_parser.py +++ b/starfish/core/imagestack/parser/tileset/_parser.py @@ -6,9 +6,9 @@ import numpy as np from slicedimage import Tile, TileSet -from starfish.imagestack.dataorder import AXES_DATA -from starfish.imagestack.parser import TileCollectionData, TileData, TileKey -from starfish.types import Axes, Coordinates, Number +from starfish.core.imagestack.dataorder import AXES_DATA +from starfish.core.imagestack.parser import TileCollectionData, TileData, TileKey +from starfish.core.types import Axes, Coordinates, Number class SlicedImageTile(TileData): diff --git a/starfish/imagestack/physical_coordinate_calculator.py b/starfish/core/imagestack/physical_coordinate_calculator.py similarity index 98% rename from starfish/imagestack/physical_coordinate_calculator.py rename to starfish/core/imagestack/physical_coordinate_calculator.py index 1326ba706..76daf13f3 100644 --- a/starfish/imagestack/physical_coordinate_calculator.py +++ b/starfish/core/imagestack/physical_coordinate_calculator.py @@ -1,7 +1,7 @@ from typing import Optional, Tuple, Union -from starfish.types import ( +from starfish.core.types import ( Number, ) diff --git a/starfish/intensity_table/__init__.py b/starfish/core/imagestack/test/__init__.py similarity index 100% rename from starfish/intensity_table/__init__.py rename to starfish/core/imagestack/test/__init__.py diff --git a/starfish/imagestack/test/factories/__init__.py b/starfish/core/imagestack/test/factories/__init__.py similarity index 100% rename from starfish/imagestack/test/factories/__init__.py rename to starfish/core/imagestack/test/factories/__init__.py diff --git a/starfish/imagestack/test/factories/from_codebook.py b/starfish/core/imagestack/test/factories/from_codebook.py similarity index 87% rename from starfish/imagestack/test/factories/from_codebook.py rename to starfish/core/imagestack/test/factories/from_codebook.py index c1449f6b4..6332ad005 100644 --- a/starfish/imagestack/test/factories/from_codebook.py +++ b/starfish/core/imagestack/test/factories/from_codebook.py @@ -3,9 +3,9 @@ import numpy as np from scipy.ndimage import gaussian_filter -from starfish.codebook.codebook import Codebook -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Axes, Features +from starfish.core.codebook.codebook import Codebook +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Axes, Features def create_imagestack_from_codebook( diff --git a/starfish/imagestack/test/factories/synthetic_stack.py b/starfish/core/imagestack/test/factories/synthetic_stack.py similarity index 76% rename from starfish/imagestack/test/factories/synthetic_stack.py rename to starfish/core/imagestack/test/factories/synthetic_stack.py index 30ce79be0..e6fac1ad8 100644 --- a/starfish/imagestack/test/factories/synthetic_stack.py +++ b/starfish/core/imagestack/test/factories/synthetic_stack.py @@ -1,7 +1,7 @@ -from starfish.experiment.builder import build_image, TileFetcher -from starfish.experiment.builder.defaultproviders import OnesTile, tile_fetcher_factory -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Axes +from starfish.core.experiment.builder import build_image, TileFetcher +from starfish.core.experiment.builder.defaultproviders import OnesTile, tile_fetcher_factory +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Axes def synthetic_stack( diff --git a/starfish/imagestack/test/factories/unique_tiles.py b/starfish/core/imagestack/test/factories/unique_tiles.py similarity index 91% rename from starfish/imagestack/test/factories/unique_tiles.py rename to starfish/core/imagestack/test/factories/unique_tiles.py index 5982ff246..6288e67b7 100644 --- a/starfish/imagestack/test/factories/unique_tiles.py +++ b/starfish/core/imagestack/test/factories/unique_tiles.py @@ -4,10 +4,10 @@ from skimage import img_as_float32 from slicedimage import ImageFormat -from starfish.experiment.builder import build_image, FetchedTile, tile_fetcher_factory -from starfish.imagestack.imagestack import ImageStack -from starfish.imagestack.parser.crop import CropParameters -from starfish.types import Axes, Coordinates, Number +from starfish.core.experiment.builder import build_image, FetchedTile, tile_fetcher_factory +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.imagestack.parser.crop import CropParameters +from starfish.core.types import Axes, Coordinates, Number X_COORDS = 0.01, 0.1 Y_COORDS = 0.001, 0.01 diff --git a/starfish/imagestack/test/factories/with_coords.py b/starfish/core/imagestack/test/factories/with_coords.py similarity index 90% rename from starfish/imagestack/test/factories/with_coords.py rename to starfish/core/imagestack/test/factories/with_coords.py index d6400af90..df368b375 100644 --- a/starfish/imagestack/test/factories/with_coords.py +++ b/starfish/core/imagestack/test/factories/with_coords.py @@ -3,9 +3,9 @@ import numpy as np import xarray as xr -from starfish.imagestack import physical_coordinate_calculator -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Axes, Coordinates, PhysicalCoordinateTypes +from starfish.core.imagestack import physical_coordinate_calculator +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Axes, Coordinates, PhysicalCoordinateTypes from .synthetic_stack import synthetic_stack diff --git a/starfish/imagestack/test/imagestack_test_utils.py b/starfish/core/imagestack/test/imagestack_test_utils.py similarity index 95% rename from starfish/imagestack/test/imagestack_test_utils.py rename to starfish/core/imagestack/test/imagestack_test_utils.py index f1d049e50..a37942f6f 100644 --- a/starfish/imagestack/test/imagestack_test_utils.py +++ b/starfish/core/imagestack/test/imagestack_test_utils.py @@ -3,8 +3,8 @@ import numpy as np -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Axes, Coordinates +from starfish.core.types import Axes, Coordinates +from ..imagestack import ImageStack def verify_stack_data( diff --git a/starfish/imagestack/test/test_apply.py b/starfish/core/imagestack/test/test_apply.py similarity index 96% rename from starfish/imagestack/test/test_apply.py rename to starfish/core/imagestack/test/test_apply.py index 5060bac67..2f93670b4 100644 --- a/starfish/imagestack/test/test_apply.py +++ b/starfish/core/imagestack/test/test_apply.py @@ -3,10 +3,10 @@ import numpy as np import xarray as xr -from starfish.imagestack.imagestack import ImageStack -from starfish.test.factories import SyntheticData -from starfish.types import Axes, Clip +from starfish.core.test.factories import SyntheticData +from starfish.core.types import Axes, Clip from .factories import synthetic_stack +from ..imagestack import ImageStack def divide(array, value): diff --git a/starfish/imagestack/test/test_coordinates.py b/starfish/core/imagestack/test/test_coordinates.py similarity index 96% rename from starfish/imagestack/test/test_coordinates.py rename to starfish/core/imagestack/test/test_coordinates.py index f20f6c7a8..73f01f839 100644 --- a/starfish/imagestack/test/test_coordinates.py +++ b/starfish/core/imagestack/test/test_coordinates.py @@ -3,11 +3,11 @@ import numpy as np from slicedimage import ImageFormat -from starfish.experiment.builder import FetchedTile, tile_fetcher_factory -from starfish.imagestack.physical_coordinate_calculator import get_physical_coordinates_of_z_plane +from starfish.core.experiment.builder import FetchedTile, tile_fetcher_factory from starfish.types import Axes, Coordinates, Number from .factories import synthetic_stack from .imagestack_test_utils import verify_physical_coordinates +from ..physical_coordinate_calculator import get_physical_coordinates_of_z_plane NUM_ROUND = 8 NUM_CH = 1 diff --git a/starfish/imagestack/test/test_cropped_load.py b/starfish/core/imagestack/test/test_cropped_load.py similarity index 94% rename from starfish/imagestack/test/test_cropped_load.py rename to starfish/core/imagestack/test/test_cropped_load.py index c494b1b27..0a88f88d1 100644 --- a/starfish/imagestack/test/test_cropped_load.py +++ b/starfish/core/imagestack/test/test_cropped_load.py @@ -2,17 +2,17 @@ These tests center around creating an ImageStack but selectively loading data from the original TileSet. """ -from starfish.imagestack.imagestack import ImageStack -from starfish.imagestack.parser.crop import CropParameters -from starfish.imagestack.physical_coordinate_calculator import ( - get_physical_coordinates_of_z_plane, - recalculate_physical_coordinate_range -) -from starfish.types import Axes +from starfish.core.types import Axes from .factories.unique_tiles import ( unique_data, unique_tiles_imagestack, X_COORDS, Y_COORDS, Z_COORDS, ) from .imagestack_test_utils import verify_physical_coordinates, verify_stack_data +from ..imagestack import ImageStack +from ..parser.crop import CropParameters +from ..physical_coordinate_calculator import ( + get_physical_coordinates_of_z_plane, + recalculate_physical_coordinate_range +) NUM_ROUND = 3 NUM_CH = 4 diff --git a/starfish/imagestack/test/test_export.py b/starfish/core/imagestack/test/test_export.py similarity index 88% rename from starfish/imagestack/test/test_export.py rename to starfish/core/imagestack/test/test_export.py index 1edc9d8e2..588d9e51f 100644 --- a/starfish/imagestack/test/test_export.py +++ b/starfish/core/imagestack/test/test_export.py @@ -3,11 +3,11 @@ import pytest from slicedimage import ImageFormat -from starfish.imagestack.imagestack import ImageStack -from starfish.imagestack.physical_coordinate_calculator import get_physical_coordinates_of_z_plane -from starfish.types import Axes, PhysicalCoordinateTypes +from starfish.core.types import Axes, PhysicalCoordinateTypes from .factories import imagestack_with_coords_factory from .imagestack_test_utils import verify_physical_coordinates +from ..imagestack import ImageStack +from ..physical_coordinate_calculator import get_physical_coordinates_of_z_plane X_COORDS = 1, 2 Y_COORDS = 4, 6 diff --git a/starfish/imagestack/test/test_from_numpy_array.py b/starfish/core/imagestack/test/test_from_numpy_array.py similarity index 93% rename from starfish/imagestack/test/test_from_numpy_array.py rename to starfish/core/imagestack/test/test_from_numpy_array.py index cf3cfafdf..4bfcdf259 100644 --- a/starfish/imagestack/test/test_from_numpy_array.py +++ b/starfish/core/imagestack/test/test_from_numpy_array.py @@ -1,7 +1,7 @@ import numpy as np import pytest -from starfish.imagestack.imagestack import ImageStack +from ..imagestack import ImageStack def test_from_numpy_array_raises_error_when_incorrect_dims_passed(): diff --git a/starfish/imagestack/test/test_index.py b/starfish/core/imagestack/test/test_index.py similarity index 98% rename from starfish/imagestack/test/test_index.py rename to starfish/core/imagestack/test/test_index.py index 2e4217289..4e318c0b5 100644 --- a/starfish/imagestack/test/test_index.py +++ b/starfish/core/imagestack/test/test_index.py @@ -4,10 +4,10 @@ import numpy as np -from starfish import ImageStack -from starfish.imagestack import indexing_utils as iu -from starfish.types import Axes, Coordinates, PhysicalCoordinateTypes +from starfish.core.imagestack import indexing_utils as iu +from starfish.core.types import Axes, Coordinates, PhysicalCoordinateTypes from .factories import imagestack_with_coords_factory, synthetic_stack +from ..imagestack import ImageStack def test_imagestack_indexing(): diff --git a/starfish/imagestack/test/test_labeled_indices.py b/starfish/core/imagestack/test/test_labeled_indices.py similarity index 97% rename from starfish/imagestack/test/test_labeled_indices.py rename to starfish/core/imagestack/test/test_labeled_indices.py index 4d7234dc2..80af4f1c0 100644 --- a/starfish/imagestack/test/test_labeled_indices.py +++ b/starfish/core/imagestack/test/test_labeled_indices.py @@ -4,13 +4,13 @@ """ import numpy as np -from starfish.imagestack.imagestack import ImageStack -from starfish.imagestack.physical_coordinate_calculator import get_physical_coordinates_of_z_plane from starfish.types import Axes from .factories.unique_tiles import ( unique_data, unique_tiles_imagestack, X_COORDS, Y_COORDS, Z_COORDS, ) from .imagestack_test_utils import verify_physical_coordinates, verify_stack_data +from ..imagestack import ImageStack +from ..physical_coordinate_calculator import get_physical_coordinates_of_z_plane ROUND_LABELS = (1, 4, 6) CH_LABELS = (2, 4, 6, 8) diff --git a/starfish/imagestack/test/test_max_proj.py b/starfish/core/imagestack/test/test_max_proj.py similarity index 80% rename from starfish/imagestack/test/test_max_proj.py rename to starfish/core/imagestack/test/test_max_proj.py index c46165633..fe920c653 100644 --- a/starfish/imagestack/test/test_max_proj.py +++ b/starfish/core/imagestack/test/test_max_proj.py @@ -1,7 +1,7 @@ import numpy as np -from starfish.imagestack.imagestack import ImageStack -from starfish.types import Axes +from starfish.core.types import Axes +from ..imagestack import ImageStack def test_max_projection_preserves_dtype(): diff --git a/starfish/imagestack/test/test_metadata.py b/starfish/core/imagestack/test/test_metadata.py similarity index 94% rename from starfish/imagestack/test/test_metadata.py rename to starfish/core/imagestack/test/test_metadata.py index 92e8e490a..df6160b86 100644 --- a/starfish/imagestack/test/test_metadata.py +++ b/starfish/core/imagestack/test/test_metadata.py @@ -1,7 +1,7 @@ import pytest -from starfish.experiment.builder.defaultproviders import OnesTile, tile_fetcher_factory -from starfish.types import Axes +from starfish.core.experiment.builder.defaultproviders import OnesTile, tile_fetcher_factory +from starfish.core.types import Axes from .factories import synthetic_stack NUM_ROUND = 4 diff --git a/starfish/imagestack/test/test_slice_ops.py b/starfish/core/imagestack/test/test_slice_ops.py similarity index 99% rename from starfish/imagestack/test/test_slice_ops.py rename to starfish/core/imagestack/test/test_slice_ops.py index 953e00f25..721042893 100644 --- a/starfish/imagestack/test/test_slice_ops.py +++ b/starfish/core/imagestack/test/test_slice_ops.py @@ -1,6 +1,6 @@ import numpy as np -from starfish.types import Axes +from starfish.core.types import Axes from .factories import synthetic_stack diff --git a/starfish/imagestack/test/test_slicedimage_dtype.py b/starfish/core/imagestack/test/test_slicedimage_dtype.py similarity index 96% rename from starfish/imagestack/test/test_slicedimage_dtype.py rename to starfish/core/imagestack/test/test_slicedimage_dtype.py index 0c7a0b15b..df92e2d9e 100644 --- a/starfish/imagestack/test/test_slicedimage_dtype.py +++ b/starfish/core/imagestack/test/test_slicedimage_dtype.py @@ -6,9 +6,9 @@ from skimage import img_as_float32 from slicedimage import ImageFormat -from starfish.errors import DataFormatWarning -from starfish.experiment.builder import FetchedTile, TileFetcher -from starfish.types import Axes, Coordinates, Number +from starfish.core.errors import DataFormatWarning +from starfish.core.experiment.builder import FetchedTile, TileFetcher +from starfish.core.types import Axes, Coordinates, Number from .factories import synthetic_stack NUM_ROUND = 2 diff --git a/starfish/intensity_table/test/__init__.py b/starfish/core/intensity_table/__init__.py similarity index 100% rename from starfish/intensity_table/test/__init__.py rename to starfish/core/intensity_table/__init__.py diff --git a/starfish/intensity_table/concatenate.py b/starfish/core/intensity_table/concatenate.py similarity index 96% rename from starfish/intensity_table/concatenate.py rename to starfish/core/intensity_table/concatenate.py index 06b7740ab..b97d7e60d 100644 --- a/starfish/intensity_table/concatenate.py +++ b/starfish/core/intensity_table/concatenate.py @@ -2,7 +2,7 @@ import xarray as xr -from starfish.types import Features +from starfish.core.types import Features from .intensity_table import IntensityTable diff --git a/starfish/intensity_table/intensity_table.py b/starfish/core/intensity_table/intensity_table.py similarity index 98% rename from starfish/intensity_table/intensity_table.py rename to starfish/core/intensity_table/intensity_table.py index b5d951a6b..30951497b 100644 --- a/starfish/intensity_table/intensity_table.py +++ b/starfish/core/intensity_table/intensity_table.py @@ -6,8 +6,8 @@ import pandas as pd import xarray as xr -from starfish.expression_matrix.expression_matrix import ExpressionMatrix -from starfish.types import ( +from starfish.core.expression_matrix.expression_matrix import ExpressionMatrix +from starfish.core.types import ( Axes, Coordinates, DecodedSpots, @@ -17,7 +17,7 @@ SpotAttributes, STARFISH_EXTRAS_KEY ) -from starfish.util.dtype import preserve_float_range +from starfish.core.util.dtype import preserve_float_range from .overlap import ( find_overlaps_of_xarrays, OVERLAP_STRATEGY_MAP, @@ -46,7 +46,7 @@ class IntensityTable(xr.DataArray): -------- Create an IntensityTable using the ``synthetic_intensities`` method:: - >>> from starfish.test.factories import SyntheticData + >>> from starfish.core.test.factories import SyntheticData >>> sd = SyntheticData(n_ch=3, n_round=4, n_codes=2) >>> codes = sd.codebook() >>> sd.intensities(codebook=codes) diff --git a/starfish/intensity_table/intensity_table_coordinates.py b/starfish/core/intensity_table/intensity_table_coordinates.py similarity index 87% rename from starfish/intensity_table/intensity_table_coordinates.py rename to starfish/core/intensity_table/intensity_table_coordinates.py index 3a31d2446..1a23da3a2 100644 --- a/starfish/intensity_table/intensity_table_coordinates.py +++ b/starfish/core/intensity_table/intensity_table_coordinates.py @@ -1,9 +1,9 @@ import numpy as np import xarray as xr -from starfish.imagestack.imagestack import ImageStack -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.types import Axes, Coordinates, Features +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.types import Axes, Coordinates, Features def transfer_physical_coords_from_imagestack_to_intensity_table( diff --git a/starfish/intensity_table/overlap.py b/starfish/core/intensity_table/overlap.py similarity index 98% rename from starfish/intensity_table/overlap.py rename to starfish/core/intensity_table/overlap.py index 5877b33c1..4688cda5f 100644 --- a/starfish/intensity_table/overlap.py +++ b/starfish/core/intensity_table/overlap.py @@ -3,7 +3,7 @@ import xarray as xr -from starfish.types import Coordinates, Features, Number, OverlapStrategy +from starfish.core.types import Coordinates, Features, Number, OverlapStrategy class Area: diff --git a/starfish/multiprocessing/__init__.py b/starfish/core/intensity_table/test/__init__.py similarity index 100% rename from starfish/multiprocessing/__init__.py rename to starfish/core/intensity_table/test/__init__.py diff --git a/starfish/intensity_table/test/factories.py b/starfish/core/intensity_table/test/factories.py similarity index 86% rename from starfish/intensity_table/test/factories.py rename to starfish/core/intensity_table/test/factories.py index 13db9a365..ef8af4ae7 100644 --- a/starfish/intensity_table/test/factories.py +++ b/starfish/core/intensity_table/test/factories.py @@ -2,9 +2,9 @@ import xarray as xr from starfish import IntensityTable -from starfish.codebook.test.factories import codebook_array_factory, loaded_codebook -from starfish.intensity_table.overlap import Area -from starfish.types import Coordinates, Features +from starfish.core.codebook.test.factories import codebook_array_factory, loaded_codebook +from starfish.core.types import Coordinates, Features +from ..overlap import Area def synthetic_intensity_table() -> IntensityTable: diff --git a/starfish/intensity_table/test/test_concatenate.py b/starfish/core/intensity_table/test/test_concatenate.py similarity index 96% rename from starfish/intensity_table/test/test_concatenate.py rename to starfish/core/intensity_table/test/test_concatenate.py index 3c35cf135..8869361f2 100644 --- a/starfish/intensity_table/test/test_concatenate.py +++ b/starfish/core/intensity_table/test/test_concatenate.py @@ -1,7 +1,7 @@ import numpy as np from starfish import ImageStack, IntensityTable -from starfish.intensity_table.concatenate import concatenate +from ..concatenate import concatenate def test_intensity_table_concatenation(): diff --git a/starfish/intensity_table/test/test_empty_intensity_table.py b/starfish/core/intensity_table/test/test_empty_intensity_table.py similarity index 92% rename from starfish/intensity_table/test/test_empty_intensity_table.py rename to starfish/core/intensity_table/test/test_empty_intensity_table.py index 7f7e9035a..8fbc66ca6 100644 --- a/starfish/intensity_table/test/test_empty_intensity_table.py +++ b/starfish/core/intensity_table/test/test_empty_intensity_table.py @@ -6,8 +6,8 @@ import pandas as pd import pytest -from starfish import IntensityTable -from starfish.types import Axes, Features, SpotAttributes +from starfish.core.types import Axes, Features, SpotAttributes +from ..intensity_table import IntensityTable def test_intensity_table_can_be_created_from_spot_attributes(): diff --git a/starfish/intensity_table/test/test_from_imagestack.py b/starfish/core/intensity_table/test/test_from_imagestack.py similarity index 92% rename from starfish/intensity_table/test/test_from_imagestack.py rename to starfish/core/intensity_table/test/test_from_imagestack.py index b6997b570..7445998a2 100644 --- a/starfish/intensity_table/test/test_from_imagestack.py +++ b/starfish/core/intensity_table/test/test_from_imagestack.py @@ -4,13 +4,14 @@ import numpy as np -from starfish import ImageStack, IntensityTable -from starfish.imagestack.test import test_labeled_indices -from starfish.test.factories import ( +from starfish import ImageStack +from starfish.core.imagestack.test import test_labeled_indices +from starfish.core.test.factories import ( codebook_intensities_image_for_single_synthetic_spot, synthetic_spot_pass_through_stack, ) -from starfish.types import Axes +from starfish.core.types import Axes +from ..intensity_table import IntensityTable # TODO ambrosejcarr: improve the tests here. diff --git a/starfish/intensity_table/test/test_from_spot_data.py b/starfish/core/intensity_table/test/test_from_spot_data.py similarity index 94% rename from starfish/intensity_table/test/test_from_spot_data.py rename to starfish/core/intensity_table/test/test_from_spot_data.py index 9a456aa86..05dd3748b 100644 --- a/starfish/intensity_table/test/test_from_spot_data.py +++ b/starfish/core/intensity_table/test/test_from_spot_data.py @@ -6,8 +6,8 @@ import pandas as pd import pytest -from starfish import IntensityTable -from starfish.types import Axes, Features, SpotAttributes +from starfish.core.types import Axes, Features, SpotAttributes +from ..intensity_table import IntensityTable def spot_attribute_factory(n: int) -> SpotAttributes: diff --git a/starfish/intensity_table/test/test_intensity_table_coords.py b/starfish/core/intensity_table/test/test_intensity_table_coords.py similarity index 87% rename from starfish/intensity_table/test/test_intensity_table_coords.py rename to starfish/core/intensity_table/test/test_intensity_table_coords.py index 95b00da5b..cf14eea1e 100644 --- a/starfish/intensity_table/test/test_intensity_table_coords.py +++ b/starfish/core/intensity_table/test/test_intensity_table_coords.py @@ -4,11 +4,13 @@ import numpy as np -from starfish import IntensityTable -from starfish.codebook.test.factories import codebook_array_factory -from starfish.imagestack.test.factories import imagestack_with_coords_factory -from starfish.intensity_table import intensity_table_coordinates -from starfish.types import Axes, Coordinates, Features, PhysicalCoordinateTypes +from starfish.core.codebook.test.factories import codebook_array_factory +from starfish.core.imagestack.test.factories import imagestack_with_coords_factory +from starfish.core.types import Axes, Coordinates, Features, PhysicalCoordinateTypes +from ..intensity_table import IntensityTable +from ..intensity_table_coordinates import ( + transfer_physical_coords_from_imagestack_to_intensity_table, +) NUMBER_SPOTS = 10 @@ -42,8 +44,7 @@ def test_tranfering_physical_coords_to_intensity_table(): n_spots=NUMBER_SPOTS ) - intensities = intensity_table_coordinates.\ - transfer_physical_coords_from_imagestack_to_intensity_table(stack, intensities) + intensities = transfer_physical_coords_from_imagestack_to_intensity_table(stack, intensities) # Assert that new cords were added xc = intensities.coords[Coordinates.X] @@ -93,8 +94,7 @@ def test_tranfering_physical_coords_to_expression_matrix(): n_spots=NUMBER_SPOTS ) - intensities = intensity_table_coordinates. \ - transfer_physical_coords_from_imagestack_to_intensity_table(stack, intensities) + intensities = transfer_physical_coords_from_imagestack_to_intensity_table(stack, intensities) # Check that error is thrown before target assignment try: diff --git a/starfish/intensity_table/test/test_intensity_table_serialization.py b/starfish/core/intensity_table/test/test_intensity_table_serialization.py similarity index 90% rename from starfish/intensity_table/test/test_intensity_table_serialization.py rename to starfish/core/intensity_table/test/test_intensity_table_serialization.py index 03e4d1189..782effece 100644 --- a/starfish/intensity_table/test/test_intensity_table_serialization.py +++ b/starfish/core/intensity_table/test/test_intensity_table_serialization.py @@ -7,7 +7,8 @@ import numpy as np -from starfish import ImageStack, IntensityTable +from starfish import ImageStack +from ..intensity_table import IntensityTable def test_intensity_table_serialization(): diff --git a/starfish/intensity_table/test/test_overlap.py b/starfish/core/intensity_table/test/test_overlap.py similarity index 97% rename from starfish/intensity_table/test/test_overlap.py rename to starfish/core/intensity_table/test/test_overlap.py index 40133b005..004851af2 100644 --- a/starfish/intensity_table/test/test_overlap.py +++ b/starfish/core/intensity_table/test/test_overlap.py @@ -1,15 +1,15 @@ import numpy as np from starfish import IntensityTable -from starfish.intensity_table.overlap import ( +from starfish.core.types import Coordinates, Features +from starfish.core.types._constants import OverlapStrategy +from .factories import create_intensity_table_with_coords +from ..overlap import ( Area, find_overlaps_of_xarrays, remove_area_of_xarray, sel_area_of_xarray ) -from starfish.types import Coordinates, Features -from starfish.types._constants import OverlapStrategy -from .factories import create_intensity_table_with_coords def test_find_area_intersection(): diff --git a/starfish/intensity_table/test/test_stack_intensity_table_reshaping.py b/starfish/core/intensity_table/test/test_stack_intensity_table_reshaping.py similarity index 90% rename from starfish/intensity_table/test/test_stack_intensity_table_reshaping.py rename to starfish/core/intensity_table/test/test_stack_intensity_table_reshaping.py index 1de17d362..e0af46646 100644 --- a/starfish/intensity_table/test/test_stack_intensity_table_reshaping.py +++ b/starfish/core/intensity_table/test/test_stack_intensity_table_reshaping.py @@ -2,9 +2,9 @@ import numpy as np -from starfish.imagestack.imagestack import ImageStack -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.types import Axes +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.types import Axes +from ..intensity_table import IntensityTable def test_reshaping_between_stack_and_intensities(): diff --git a/starfish/intensity_table/test/test_synthetic_intensities.py b/starfish/core/intensity_table/test/test_synthetic_intensities.py similarity index 90% rename from starfish/intensity_table/test/test_synthetic_intensities.py rename to starfish/core/intensity_table/test/test_synthetic_intensities.py index 00594a9e4..10c12160e 100644 --- a/starfish/intensity_table/test/test_synthetic_intensities.py +++ b/starfish/core/intensity_table/test/test_synthetic_intensities.py @@ -4,9 +4,9 @@ import numpy as np -from starfish import IntensityTable -from starfish.codebook.test.factories import codebook_array_factory -from starfish.types import Axes, Features +from starfish.core.codebook.test.factories import codebook_array_factory +from starfish.core.types import Axes, Features +from ..intensity_table import IntensityTable def test_synthetic_intensity_generation(): diff --git a/starfish/intensity_table/test/test_to_mermaid.py b/starfish/core/intensity_table/test/test_to_mermaid.py similarity index 90% rename from starfish/intensity_table/test/test_to_mermaid.py rename to starfish/core/intensity_table/test/test_to_mermaid.py index deee55998..0f7da77b0 100644 --- a/starfish/intensity_table/test/test_to_mermaid.py +++ b/starfish/core/intensity_table/test/test_to_mermaid.py @@ -4,8 +4,9 @@ import numpy as np import pytest -from starfish import ImageStack, IntensityTable -from starfish.types import Features +from starfish import ImageStack +from starfish.core.types import Features +from ..intensity_table import IntensityTable def test_to_mermaid_dataframe(): diff --git a/starfish/multiprocessing/test/__init__.py b/starfish/core/multiprocessing/__init__.py similarity index 100% rename from starfish/multiprocessing/test/__init__.py rename to starfish/core/multiprocessing/__init__.py diff --git a/starfish/multiprocessing/pool.py b/starfish/core/multiprocessing/pool.py similarity index 100% rename from starfish/multiprocessing/pool.py rename to starfish/core/multiprocessing/pool.py diff --git a/starfish/multiprocessing/shmem.py b/starfish/core/multiprocessing/shmem.py similarity index 100% rename from starfish/multiprocessing/shmem.py rename to starfish/core/multiprocessing/shmem.py diff --git a/starfish/recipe/test/__init__.py b/starfish/core/multiprocessing/test/__init__.py similarity index 100% rename from starfish/recipe/test/__init__.py rename to starfish/core/multiprocessing/test/__init__.py diff --git a/starfish/multiprocessing/test/test_multiprocessing.py b/starfish/core/multiprocessing/test/test_multiprocessing.py similarity index 98% rename from starfish/multiprocessing/test/test_multiprocessing.py rename to starfish/core/multiprocessing/test/test_multiprocessing.py index bc6cd2326..8bcf3db7b 100644 --- a/starfish/multiprocessing/test/test_multiprocessing.py +++ b/starfish/core/multiprocessing/test/test_multiprocessing.py @@ -18,8 +18,8 @@ import xarray as xr from starfish import ImageStack -from starfish.imagestack import _mp_dataarray -from starfish.multiprocessing.shmem import SharedMemory +from starfish.core.imagestack import _mp_dataarray +from ..shmem import SharedMemory def test_numpy_array(nitems: int=10): diff --git a/starfish/pipeline/__init__.py b/starfish/core/pipeline/__init__.py similarity index 100% rename from starfish/pipeline/__init__.py rename to starfish/core/pipeline/__init__.py diff --git a/starfish/pipeline/algorithmbase.py b/starfish/core/pipeline/algorithmbase.py similarity index 93% rename from starfish/pipeline/algorithmbase.py rename to starfish/core/pipeline/algorithmbase.py index 7d728045a..c52a9e5e9 100644 --- a/starfish/pipeline/algorithmbase.py +++ b/starfish/core/pipeline/algorithmbase.py @@ -2,11 +2,11 @@ from abc import ABCMeta, abstractmethod from typing import Type -from starfish.imagestack.imagestack import ImageStack -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.types import LOG -from starfish.types._constants import STARFISH_EXTRAS_KEY -from starfish.util.logging import LogEncoder +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.types import LOG +from starfish.core.types._constants import STARFISH_EXTRAS_KEY +from starfish.core.util.logging import LogEncoder from .pipelinecomponent import PipelineComponent diff --git a/starfish/pipeline/pipelinecomponent.py b/starfish/core/pipeline/pipelinecomponent.py similarity index 100% rename from starfish/pipeline/pipelinecomponent.py rename to starfish/core/pipeline/pipelinecomponent.py diff --git a/starfish/recipe/__init__.py b/starfish/core/recipe/__init__.py similarity index 100% rename from starfish/recipe/__init__.py rename to starfish/core/recipe/__init__.py diff --git a/starfish/recipe/cli.py b/starfish/core/recipe/cli.py similarity index 87% rename from starfish/recipe/cli.py rename to starfish/core/recipe/cli.py index d28432456..3adb311d3 100644 --- a/starfish/recipe/cli.py +++ b/starfish/core/recipe/cli.py @@ -1,8 +1,8 @@ from slicedimage.io import resolve_path_or_url -from starfish.config import StarfishConfig -from starfish.starfish import starfish -from starfish.util import click +from starfish.core.config import StarfishConfig +from starfish.core.starfish import starfish +from starfish.core.util import click from .recipe import Recipe diff --git a/starfish/recipe/errors.py b/starfish/core/recipe/errors.py similarity index 100% rename from starfish/recipe/errors.py rename to starfish/core/recipe/errors.py diff --git a/starfish/recipe/filesystem.py b/starfish/core/recipe/filesystem.py similarity index 92% rename from starfish/recipe/filesystem.py rename to starfish/core/recipe/filesystem.py index 497e2e402..a1ac6ec35 100644 --- a/starfish/recipe/filesystem.py +++ b/starfish/core/recipe/filesystem.py @@ -1,11 +1,11 @@ import enum from typing import Any, Callable, Type -from starfish.codebook.codebook import Codebook -from starfish.expression_matrix.expression_matrix import ExpressionMatrix -from starfish.imagestack.imagestack import ImageStack -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.util.indirectfile import ( +from starfish.core.codebook.codebook import Codebook +from starfish.core.expression_matrix.expression_matrix import ExpressionMatrix +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.util.indirectfile import ( convert, GetCodebook, GetCodebookFromExperiment, diff --git a/starfish/recipe/recipe.py b/starfish/core/recipe/recipe.py similarity index 100% rename from starfish/recipe/recipe.py rename to starfish/core/recipe/recipe.py diff --git a/starfish/recipe/runnable.py b/starfish/core/recipe/runnable.py similarity index 99% rename from starfish/recipe/runnable.py rename to starfish/core/recipe/runnable.py index 8bcb4e414..e0417a2c9 100644 --- a/starfish/recipe/runnable.py +++ b/starfish/core/recipe/runnable.py @@ -12,7 +12,7 @@ Type, ) -from starfish.pipeline.algorithmbase import AlgorithmBase +from starfish.core.pipeline.algorithmbase import AlgorithmBase from .errors import ( ConstructorError, ConstructorExtraParameterWarning, diff --git a/starfish/spacetx_format/__init__.py b/starfish/core/recipe/test/__init__.py similarity index 100% rename from starfish/spacetx_format/__init__.py rename to starfish/core/recipe/test/__init__.py diff --git a/starfish/recipe/test/fakefilter.py b/starfish/core/recipe/test/fakefilter.py similarity index 96% rename from starfish/recipe/test/fakefilter.py rename to starfish/core/recipe/test/fakefilter.py index 9d93ce0be..69eb6f017 100644 --- a/starfish/recipe/test/fakefilter.py +++ b/starfish/core/recipe/test/fakefilter.py @@ -1,6 +1,6 @@ from starfish import ImageStack -from starfish.image._filter._base import FilterAlgorithmBase -from starfish.util import click +from starfish.core.image._filter._base import FilterAlgorithmBase +from starfish.core.util import click class SimpleFilterAlgorithm(FilterAlgorithmBase): diff --git a/starfish/recipe/test/test_recipe.py b/starfish/core/recipe/test/test_recipe.py similarity index 97% rename from starfish/recipe/test/test_recipe.py rename to starfish/core/recipe/test/test_recipe.py index 636bf7d02..0cb8c6616 100644 --- a/starfish/recipe/test/test_recipe.py +++ b/starfish/core/recipe/test/test_recipe.py @@ -6,9 +6,9 @@ import pytest from starfish import ImageStack -from starfish.recipe import ConstructorError, ConstructorExtraParameterWarning -from starfish.recipe.recipe import Recipe from . import fakefilter # noqa: F401 +from ..errors import ConstructorError, ConstructorExtraParameterWarning +from ..recipe import Recipe BASE_EXPECTED = np.array([ diff --git a/starfish/recipe/test/test_runnable.py b/starfish/core/recipe/test/test_runnable.py similarity index 98% rename from starfish/recipe/test/test_runnable.py rename to starfish/core/recipe/test/test_runnable.py index 13fa7132d..0a4a12c83 100644 --- a/starfish/recipe/test/test_runnable.py +++ b/starfish/core/recipe/test/test_runnable.py @@ -4,21 +4,21 @@ import pytest from starfish import ImageStack -from starfish.recipe import ( - ConstructorError, - ConstructorExtraParameterWarning, - ExecutionError, - RunInsufficientParametersError, - Runnable, - TypeInferenceError, -) -from starfish.recipe.filesystem import FileProvider from .fakefilter import ( AdditiveFilterAlgorithm, FilterAlgorithmWithMissingConstructorTyping, FilterAlgorithmWithMissingRunTyping, SimpleFilterAlgorithm, ) +from ..errors import ( + ConstructorError, + ConstructorExtraParameterWarning, + ExecutionError, + RunInsufficientParametersError, + TypeInferenceError, +) +from ..filesystem import FileProvider +from ..runnable import Runnable BASE_EXPECTED = np.array([ diff --git a/starfish/segmentation_mask.py b/starfish/core/segmentation_mask.py similarity index 99% rename from starfish/segmentation_mask.py rename to starfish/core/segmentation_mask.py index 38db00ff3..542b01ccd 100644 --- a/starfish/segmentation_mask.py +++ b/starfish/core/segmentation_mask.py @@ -6,7 +6,7 @@ import xarray as xr from skimage.measure import regionprops -from starfish.types import Axes, Coordinates +from starfish.core.types import Axes, Coordinates AXES = [a.value for a in Axes if a not in (Axes.ROUND, Axes.CH)] diff --git a/starfish/spots/_detect_pixels/test/__init__.py b/starfish/core/spacetx_format/__init__.py similarity index 100% rename from starfish/spots/_detect_pixels/test/__init__.py rename to starfish/core/spacetx_format/__init__.py diff --git a/starfish/spacetx_format/cli.py b/starfish/core/spacetx_format/cli.py similarity index 99% rename from starfish/spacetx_format/cli.py rename to starfish/core/spacetx_format/cli.py index 541bc4cef..87609139e 100644 --- a/starfish/spacetx_format/cli.py +++ b/starfish/core/spacetx_format/cli.py @@ -2,7 +2,7 @@ import xarray as xr -from starfish.util import click +from starfish.core.util import click from . import validate_sptx diff --git a/starfish/spacetx_format/test/test_validate.py b/starfish/core/spacetx_format/test/test_validate.py similarity index 86% rename from starfish/spacetx_format/test/test_validate.py rename to starfish/core/spacetx_format/test/test_validate.py index a2775b650..ece7ecb19 100644 --- a/starfish/spacetx_format/test/test_validate.py +++ b/starfish/core/spacetx_format/test/test_validate.py @@ -1,6 +1,6 @@ import unittest -from starfish.util import exec +from starfish.core.util import exec class TestValidateCommand(unittest.TestCase): diff --git a/starfish/spacetx_format/test_codebook.py b/starfish/core/spacetx_format/test_codebook.py similarity index 96% rename from starfish/spacetx_format/test_codebook.py rename to starfish/core/spacetx_format/test_codebook.py index 64411219c..e988a9233 100644 --- a/starfish/spacetx_format/test_codebook.py +++ b/starfish/core/spacetx_format/test_codebook.py @@ -1,7 +1,7 @@ import pytest from pkg_resources import resource_filename -from starfish.codebook._format import DocumentKeys +from starfish.core.codebook._format import DocumentKeys from .util import SpaceTxValidator from .validate_sptx import validate_file diff --git a/starfish/spacetx_format/test_coordinates.py b/starfish/core/spacetx_format/test_coordinates.py similarity index 100% rename from starfish/spacetx_format/test_coordinates.py rename to starfish/core/spacetx_format/test_coordinates.py diff --git a/starfish/spacetx_format/test_experiment.py b/starfish/core/spacetx_format/test_experiment.py similarity index 100% rename from starfish/spacetx_format/test_experiment.py rename to starfish/core/spacetx_format/test_experiment.py diff --git a/starfish/spacetx_format/test_field_of_view.py b/starfish/core/spacetx_format/test_field_of_view.py similarity index 100% rename from starfish/spacetx_format/test_field_of_view.py rename to starfish/core/spacetx_format/test_field_of_view.py diff --git a/starfish/spacetx_format/test_fov_manifest.py b/starfish/core/spacetx_format/test_fov_manifest.py similarity index 100% rename from starfish/spacetx_format/test_fov_manifest.py rename to starfish/core/spacetx_format/test_fov_manifest.py diff --git a/starfish/spacetx_format/test_fuzz.py b/starfish/core/spacetx_format/test_fuzz.py similarity index 98% rename from starfish/spacetx_format/test_fuzz.py rename to starfish/core/spacetx_format/test_fuzz.py index c7dffb612..9810e2cd8 100644 --- a/starfish/spacetx_format/test_fuzz.py +++ b/starfish/core/spacetx_format/test_fuzz.py @@ -2,7 +2,7 @@ from pkg_resources import resource_filename -from starfish.codebook._format import CURRENT_VERSION, DocumentKeys +from starfish.core.codebook._format import CURRENT_VERSION, DocumentKeys from .util import Fuzzer, SpaceTxValidator package_name = "starfish" diff --git a/starfish/spacetx_format/util.py b/starfish/core/spacetx_format/util.py similarity index 100% rename from starfish/spacetx_format/util.py rename to starfish/core/spacetx_format/util.py diff --git a/starfish/spacetx_format/validate_sptx.py b/starfish/core/spacetx_format/validate_sptx.py similarity index 95% rename from starfish/spacetx_format/validate_sptx.py rename to starfish/core/spacetx_format/validate_sptx.py index 182f0ad9f..b17d5eb01 100644 --- a/starfish/spacetx_format/validate_sptx.py +++ b/starfish/core/spacetx_format/validate_sptx.py @@ -7,8 +7,8 @@ from slicedimage.backends._base import Backend from slicedimage.io import resolve_path_or_url -from starfish.config import StarfishConfig -from starfish.util import click +from starfish.core.config import StarfishConfig +from starfish.core.util import click from .util import SpaceTxValidator @@ -46,7 +46,7 @@ def validate(experiment_json: str, fuzz: bool=False) -> bool: The following will read the experiment json file provided, downloading it if necessary, and begin recursively validating it and all referenced json files (e.g. codebook.json): - >>> from starfish.spacetx_format import validate_sptx + >>> from starfish.core.spacetx_format import validate_sptx >>> valid = validate_sptx.validate(json_url) """ @@ -112,7 +112,7 @@ def validate_file(file: str, schema: str, fuzz: bool=False, -------- The following will read the codebook json file provided, downloading it if necessary: - >>> from starfish.spacetx_format.validate_sptx import validate_file + >>> from starfish.core.spacetx_format.validate_sptx import validate_file >>> valid = validate_sptx.validate_file(json_url, "codebook/codebook.json") """ diff --git a/starfish/spots/__init__.py b/starfish/core/spots/__init__.py similarity index 100% rename from starfish/spots/__init__.py rename to starfish/core/spots/__init__.py diff --git a/starfish/spots/_assign_targets/__init__.py b/starfish/core/spots/_assign_targets/__init__.py similarity index 57% rename from starfish/spots/_assign_targets/__init__.py rename to starfish/core/spots/_assign_targets/__init__.py index b4f2879fd..d5a0d61f8 100644 --- a/starfish/spots/_assign_targets/__init__.py +++ b/starfish/core/spots/_assign_targets/__init__.py @@ -1,3 +1,3 @@ -from starfish.pipeline import import_all_submodules +from starfish.core.pipeline import import_all_submodules from ._base import AssignTargets import_all_submodules(__file__, __package__) diff --git a/starfish/spots/_assign_targets/_base.py b/starfish/core/spots/_assign_targets/_base.py similarity index 85% rename from starfish/spots/_assign_targets/_base.py rename to starfish/core/spots/_assign_targets/_base.py index eb37fd27c..eef59f5c6 100644 --- a/starfish/spots/_assign_targets/_base.py +++ b/starfish/core/spots/_assign_targets/_base.py @@ -4,11 +4,11 @@ import numpy as np -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.pipeline.algorithmbase import AlgorithmBase -from starfish.pipeline.pipelinecomponent import PipelineComponent -from starfish.segmentation_mask import SegmentationMaskCollection -from starfish.util import click +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.pipeline.algorithmbase import AlgorithmBase +from starfish.core.pipeline.pipelinecomponent import PipelineComponent +from starfish.core.segmentation_mask import SegmentationMaskCollection +from starfish.core.util import click class AssignTargets(PipelineComponent): diff --git a/starfish/spots/_assign_targets/label.py b/starfish/core/spots/_assign_targets/label.py similarity index 91% rename from starfish/spots/_assign_targets/label.py rename to starfish/core/spots/_assign_targets/label.py index 8220485fd..6164e547b 100644 --- a/starfish/spots/_assign_targets/label.py +++ b/starfish/core/spots/_assign_targets/label.py @@ -1,9 +1,9 @@ import numpy as np -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.segmentation_mask import SegmentationMaskCollection -from starfish.types import Features -from starfish.util import click +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.segmentation_mask import SegmentationMaskCollection +from starfish.core.types import Features +from starfish.core.util import click from ._base import AssignTargetsAlgorithm diff --git a/starfish/spots/_decode/__init__.py b/starfish/core/spots/_decode/__init__.py similarity index 55% rename from starfish/spots/_decode/__init__.py rename to starfish/core/spots/_decode/__init__.py index a4815e5a4..5d1785b28 100644 --- a/starfish/spots/_decode/__init__.py +++ b/starfish/core/spots/_decode/__init__.py @@ -1,3 +1,3 @@ -from starfish.pipeline import import_all_submodules +from starfish.core.pipeline import import_all_submodules from ._base import Decode import_all_submodules(__file__, __package__) diff --git a/starfish/spots/_decode/_base.py b/starfish/core/spots/_decode/_base.py similarity index 85% rename from starfish/spots/_decode/_base.py rename to starfish/core/spots/_decode/_base.py index f1074cd25..bb7dca542 100644 --- a/starfish/spots/_decode/_base.py +++ b/starfish/core/spots/_decode/_base.py @@ -1,11 +1,11 @@ from abc import abstractmethod from typing import Type -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.pipeline.algorithmbase import AlgorithmBase -from starfish.pipeline.pipelinecomponent import PipelineComponent -from starfish.util import click -from starfish.util.click.indirectparams import CodebookParamType +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.pipeline.algorithmbase import AlgorithmBase +from starfish.core.pipeline.pipelinecomponent import PipelineComponent +from starfish.core.util import click +from starfish.core.util.click.indirectparams import CodebookParamType class Decode(PipelineComponent): diff --git a/starfish/spots/_decode/metric_decoder.py b/starfish/core/spots/_decode/metric_decoder.py similarity index 94% rename from starfish/spots/_decode/metric_decoder.py rename to starfish/core/spots/_decode/metric_decoder.py index 4d84b2ebb..d68e61f1e 100644 --- a/starfish/spots/_decode/metric_decoder.py +++ b/starfish/core/spots/_decode/metric_decoder.py @@ -1,7 +1,7 @@ -from starfish.codebook.codebook import Codebook -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.types import Number -from starfish.util import click +from starfish.core.codebook.codebook import Codebook +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.types import Number +from starfish.core.util import click from ._base import DecodeAlgorithmBase diff --git a/starfish/spots/_decode/per_round_max_channel_decoder.py b/starfish/core/spots/_decode/per_round_max_channel_decoder.py similarity index 89% rename from starfish/spots/_decode/per_round_max_channel_decoder.py rename to starfish/core/spots/_decode/per_round_max_channel_decoder.py index 66f9380f5..80b16d632 100644 --- a/starfish/spots/_decode/per_round_max_channel_decoder.py +++ b/starfish/core/spots/_decode/per_round_max_channel_decoder.py @@ -1,6 +1,6 @@ -from starfish.codebook.codebook import Codebook -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.util import click +from starfish.core.codebook.codebook import Codebook +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.util import click from ._base import DecodeAlgorithmBase diff --git a/starfish/spots/_detect_pixels/__init__.py b/starfish/core/spots/_detect_pixels/__init__.py similarity index 57% rename from starfish/spots/_detect_pixels/__init__.py rename to starfish/core/spots/_detect_pixels/__init__.py index 1ed5c7e72..0b9d66989 100644 --- a/starfish/spots/_detect_pixels/__init__.py +++ b/starfish/core/spots/_detect_pixels/__init__.py @@ -1,3 +1,3 @@ -from starfish.pipeline import import_all_submodules +from starfish.core.pipeline import import_all_submodules from ._base import DetectPixels import_all_submodules(__file__, __package__) diff --git a/starfish/spots/_detect_pixels/_base.py b/starfish/core/spots/_detect_pixels/_base.py similarity index 84% rename from starfish/spots/_detect_pixels/_base.py rename to starfish/core/spots/_detect_pixels/_base.py index ceeba6b7b..8fe06cb20 100644 --- a/starfish/spots/_detect_pixels/_base.py +++ b/starfish/core/spots/_detect_pixels/_base.py @@ -3,13 +3,13 @@ import numpy as np -from starfish.imagestack.imagestack import ImageStack -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.pipeline.algorithmbase import AlgorithmBase -from starfish.pipeline.pipelinecomponent import PipelineComponent -from starfish.types import Number -from starfish.util import click -from starfish.util.click.indirectparams import CodebookParamType, ImageStackParamType +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.pipeline.algorithmbase import AlgorithmBase +from starfish.core.pipeline.pipelinecomponent import PipelineComponent +from starfish.core.types import Number +from starfish.core.util import click +from starfish.core.util.click.indirectparams import CodebookParamType, ImageStackParamType from .combine_adjacent_features import ConnectedComponentDecodingResult diff --git a/starfish/spots/_detect_pixels/combine_adjacent_features.py b/starfish/core/spots/_detect_pixels/combine_adjacent_features.py similarity index 98% rename from starfish/spots/_detect_pixels/combine_adjacent_features.py rename to starfish/core/spots/_detect_pixels/combine_adjacent_features.py index 0124bd38a..7c2a2e2fe 100644 --- a/starfish/spots/_detect_pixels/combine_adjacent_features.py +++ b/starfish/core/spots/_detect_pixels/combine_adjacent_features.py @@ -7,10 +7,10 @@ from skimage.measure._regionprops import _RegionProperties from tqdm import tqdm -from starfish.config import StarfishConfig -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.multiprocessing.pool import Pool -from starfish.types import Axes, Features, Number, SpotAttributes +from starfish.core.config import StarfishConfig +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.multiprocessing.pool import Pool +from starfish.core.types import Axes, Features, Number, SpotAttributes class ConnectedComponentDecodingResult(NamedTuple): diff --git a/starfish/spots/_detect_pixels/pixel_spot_decoder.py b/starfish/core/spots/_detect_pixels/pixel_spot_decoder.py similarity index 94% rename from starfish/spots/_detect_pixels/pixel_spot_decoder.py rename to starfish/core/spots/_detect_pixels/pixel_spot_decoder.py index c0737521e..7a7aa9c0b 100644 --- a/starfish/spots/_detect_pixels/pixel_spot_decoder.py +++ b/starfish/core/spots/_detect_pixels/pixel_spot_decoder.py @@ -2,12 +2,12 @@ import numpy as np -from starfish.codebook.codebook import Codebook -from starfish.imagestack.imagestack import ImageStack -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.intensity_table.intensity_table_coordinates import \ +from starfish.core.codebook.codebook import Codebook +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.intensity_table.intensity_table_coordinates import \ transfer_physical_coords_from_imagestack_to_intensity_table -from starfish.util import click +from starfish.core.util import click from ._base import DetectPixelsAlgorithmBase from .combine_adjacent_features import CombineAdjacentFeatures, ConnectedComponentDecodingResult diff --git a/starfish/spots/_detect_spots/test/__init__.py b/starfish/core/spots/_detect_pixels/test/__init__.py similarity index 100% rename from starfish/spots/_detect_spots/test/__init__.py rename to starfish/core/spots/_detect_pixels/test/__init__.py diff --git a/starfish/spots/_detect_pixels/test/test_calculate_mean_pixel_traces.py b/starfish/core/spots/_detect_pixels/test/test_calculate_mean_pixel_traces.py similarity index 94% rename from starfish/spots/_detect_pixels/test/test_calculate_mean_pixel_traces.py rename to starfish/core/spots/_detect_pixels/test/test_calculate_mean_pixel_traces.py index 9970cdad2..decfd7f2c 100644 --- a/starfish/spots/_detect_pixels/test/test_calculate_mean_pixel_traces.py +++ b/starfish/core/spots/_detect_pixels/test/test_calculate_mean_pixel_traces.py @@ -8,8 +8,8 @@ from skimage.measure import label from starfish import ImageStack, IntensityTable -from starfish.spots._detect_pixels.combine_adjacent_features import CombineAdjacentFeatures -from starfish.types import Features +from starfish.core.spots._detect_pixels.combine_adjacent_features import CombineAdjacentFeatures +from starfish.core.types import Features # TODO ambrosejcarr: make sure these arrays contain background pixels to catch one-off errors diff --git a/starfish/spots/_detect_pixels/test/test_create_spot_attributes.py b/starfish/core/spots/_detect_pixels/test/test_create_spot_attributes.py similarity index 92% rename from starfish/spots/_detect_pixels/test/test_create_spot_attributes.py rename to starfish/core/spots/_detect_pixels/test/test_create_spot_attributes.py index 0dacc68e2..850a4107e 100644 --- a/starfish/spots/_detect_pixels/test/test_create_spot_attributes.py +++ b/starfish/core/spots/_detect_pixels/test/test_create_spot_attributes.py @@ -5,10 +5,10 @@ import numpy as np from skimage.measure import regionprops -from starfish.spots._detect_pixels.combine_adjacent_features import ( +from starfish.core.spots._detect_pixels.combine_adjacent_features import ( CombineAdjacentFeatures, TargetsMap ) -from starfish.types import Axes, Features, SpotAttributes +from starfish.core.types import Axes, Features, SpotAttributes from .test_calculate_mean_pixel_traces import labeled_intensities_factory # reuse this fixture diff --git a/starfish/spots/_detect_pixels/test/test_intensities_to_decoded_image.py b/starfish/core/spots/_detect_pixels/test/test_intensities_to_decoded_image.py similarity index 95% rename from starfish/spots/_detect_pixels/test/test_intensities_to_decoded_image.py rename to starfish/core/spots/_detect_pixels/test/test_intensities_to_decoded_image.py index a8e8f2721..48f811b8e 100644 --- a/starfish/spots/_detect_pixels/test/test_intensities_to_decoded_image.py +++ b/starfish/core/spots/_detect_pixels/test/test_intensities_to_decoded_image.py @@ -7,10 +7,10 @@ import numpy as np from starfish import ImageStack, IntensityTable -from starfish.spots._detect_pixels.combine_adjacent_features import ( +from starfish.core.spots._detect_pixels.combine_adjacent_features import ( CombineAdjacentFeatures, TargetsMap ) -from starfish.types import Features +from starfish.core.types import Features def decoded_intensity_table_factory() -> Tuple[IntensityTable, np.ndarray]: diff --git a/starfish/spots/_detect_pixels/test/test_targets_map.py b/starfish/core/spots/_detect_pixels/test/test_targets_map.py similarity index 85% rename from starfish/spots/_detect_pixels/test/test_targets_map.py rename to starfish/core/spots/_detect_pixels/test/test_targets_map.py index b49ad611d..6fbcba845 100644 --- a/starfish/spots/_detect_pixels/test/test_targets_map.py +++ b/starfish/core/spots/_detect_pixels/test/test_targets_map.py @@ -4,7 +4,7 @@ import numpy as np -from starfish.spots._detect_pixels.combine_adjacent_features import TargetsMap +from starfish.core.spots._detect_pixels.combine_adjacent_features import TargetsMap def test_targets_map(): diff --git a/starfish/spots/_detect_spots/__init__.py b/starfish/core/spots/_detect_spots/__init__.py similarity index 57% rename from starfish/spots/_detect_spots/__init__.py rename to starfish/core/spots/_detect_spots/__init__.py index 717d17f39..50793582d 100644 --- a/starfish/spots/_detect_spots/__init__.py +++ b/starfish/core/spots/_detect_spots/__init__.py @@ -1,3 +1,3 @@ -from starfish.pipeline import import_all_submodules +from starfish.core.pipeline import import_all_submodules from ._base import DetectSpots import_all_submodules(__file__, __package__) diff --git a/starfish/spots/_detect_spots/_base.py b/starfish/core/spots/_detect_spots/_base.py similarity index 93% rename from starfish/spots/_detect_spots/_base.py rename to starfish/core/spots/_detect_spots/_base.py index 42b1d459e..d6530eb22 100644 --- a/starfish/spots/_detect_spots/_base.py +++ b/starfish/core/spots/_detect_spots/_base.py @@ -4,13 +4,13 @@ import numpy as np import xarray as xr -from starfish.imagestack.imagestack import ImageStack -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.pipeline.algorithmbase import AlgorithmBase -from starfish.pipeline.pipelinecomponent import PipelineComponent -from starfish.types import Axes, Number, SpotAttributes -from starfish.util import click -from starfish.util.click.indirectparams import ImageStackParamType +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.pipeline.algorithmbase import AlgorithmBase +from starfish.core.pipeline.pipelinecomponent import PipelineComponent +from starfish.core.types import Axes, Number, SpotAttributes +from starfish.core.util import click +from starfish.core.util.click.indirectparams import ImageStackParamType class DetectSpots(PipelineComponent): diff --git a/starfish/spots/_detect_spots/blob.py b/starfish/core/spots/_detect_spots/blob.py similarity index 96% rename from starfish/spots/_detect_spots/blob.py rename to starfish/core/spots/_detect_spots/blob.py index 83e20f5c5..4109fda81 100644 --- a/starfish/spots/_detect_spots/blob.py +++ b/starfish/core/spots/_detect_spots/blob.py @@ -5,10 +5,10 @@ import xarray as xr from skimage.feature import blob_dog, blob_doh, blob_log -from starfish.imagestack.imagestack import ImageStack -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.types import Axes, Features, Number, SpotAttributes -from starfish.util import click +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.types import Axes, Features, Number, SpotAttributes +from starfish.core.util import click from ._base import DetectSpotsAlgorithmBase from .detect import detect_spots, measure_spot_intensity diff --git a/starfish/spots/_detect_spots/detect.py b/starfish/core/spots/_detect_spots/detect.py similarity index 97% rename from starfish/spots/_detect_spots/detect.py rename to starfish/core/spots/_detect_spots/detect.py index 4b9dd05d1..23a2823db 100644 --- a/starfish/spots/_detect_spots/detect.py +++ b/starfish/core/spots/_detect_spots/detect.py @@ -6,11 +6,11 @@ import pandas as pd import xarray as xr -from starfish.imagestack.imagestack import ImageStack -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.intensity_table.intensity_table_coordinates import \ +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.intensity_table.intensity_table_coordinates import \ transfer_physical_coords_from_imagestack_to_intensity_table -from starfish.types import Axes, Features, Number, SpotAttributes +from starfish.core.types import Axes, Features, Number, SpotAttributes def measure_spot_intensity( diff --git a/starfish/spots/_detect_spots/local_max_peak_finder.py b/starfish/core/spots/_detect_spots/local_max_peak_finder.py similarity index 97% rename from starfish/spots/_detect_spots/local_max_peak_finder.py rename to starfish/core/spots/_detect_spots/local_max_peak_finder.py index 3fdce91ab..3aa5f7ef5 100644 --- a/starfish/spots/_detect_spots/local_max_peak_finder.py +++ b/starfish/core/spots/_detect_spots/local_max_peak_finder.py @@ -9,11 +9,11 @@ from sympy import Line, Point from tqdm import tqdm -from starfish.config import StarfishConfig -from starfish.imagestack.imagestack import ImageStack -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.types import Axes, Features, Number, SpotAttributes -from starfish.util import click +from starfish.core.config import StarfishConfig +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.types import Axes, Features, Number, SpotAttributes +from starfish.core.util import click from ._base import DetectSpotsAlgorithmBase from .detect import detect_spots diff --git a/starfish/spots/_detect_spots/local_search_blob_detector.py b/starfish/core/spots/_detect_spots/local_search_blob_detector.py similarity index 97% rename from starfish/spots/_detect_spots/local_search_blob_detector.py rename to starfish/core/spots/_detect_spots/local_search_blob_detector.py index 082ad0551..86b367c63 100644 --- a/starfish/spots/_detect_spots/local_search_blob_detector.py +++ b/starfish/core/spots/_detect_spots/local_search_blob_detector.py @@ -15,14 +15,14 @@ from click import Choice from sklearn.neighbors import NearestNeighbors -from starfish.compat import blob_dog, blob_log -from starfish.image._filter.util import determine_axes_to_group_by -from starfish.imagestack.imagestack import ImageStack -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.intensity_table.intensity_table_coordinates import \ +from starfish.core.compat import blob_dog, blob_log +from starfish.core.image._filter.util import determine_axes_to_group_by +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.intensity_table.intensity_table_coordinates import \ transfer_physical_coords_from_imagestack_to_intensity_table -from starfish.types import Axes, Features, Number, SpotAttributes -from starfish.util import click +from starfish.core.types import Axes, Features, Number, SpotAttributes +from starfish.core.util import click from ._base import DetectSpotsAlgorithmBase blob_detectors = { diff --git a/starfish/test/__init__.py b/starfish/core/spots/_detect_spots/test/__init__.py similarity index 100% rename from starfish/test/__init__.py rename to starfish/core/spots/_detect_spots/test/__init__.py diff --git a/starfish/spots/_detect_spots/test/test_local_search_blob_detector.py b/starfish/core/spots/_detect_spots/test/test_local_search_blob_detector.py similarity index 97% rename from starfish/spots/_detect_spots/test/test_local_search_blob_detector.py rename to starfish/core/spots/_detect_spots/test/test_local_search_blob_detector.py index 761b9650e..3228bce8f 100644 --- a/starfish/spots/_detect_spots/test/test_local_search_blob_detector.py +++ b/starfish/core/spots/_detect_spots/test/test_local_search_blob_detector.py @@ -2,8 +2,8 @@ from scipy.ndimage.filters import gaussian_filter from starfish import ImageStack -from starfish.spots._detect_spots.local_search_blob_detector import LocalSearchBlobDetector -from starfish.types import Axes +from starfish.core.spots._detect_spots.local_search_blob_detector import LocalSearchBlobDetector +from starfish.core.types import Axes def traversing_code() -> ImageStack: diff --git a/starfish/spots/_detect_spots/test/test_spot_detection.py b/starfish/core/spots/_detect_spots/test/test_spot_detection.py similarity index 92% rename from starfish/spots/_detect_spots/test/test_spot_detection.py rename to starfish/core/spots/_detect_spots/test/test_spot_detection.py index 0695f1e77..d1cbf5ece 100644 --- a/starfish/spots/_detect_spots/test/test_spot_detection.py +++ b/starfish/core/spots/_detect_spots/test/test_spot_detection.py @@ -1,18 +1,18 @@ import numpy as np import pytest -from starfish.imagestack.imagestack import ImageStack -from starfish.spots._detect_spots._base import DetectSpotsAlgorithmBase -from starfish.spots._detect_spots.blob import BlobDetector -from starfish.spots._detect_spots.detect import detect_spots -from starfish.spots._detect_spots.local_max_peak_finder import LocalMaxPeakFinder -from starfish.spots._detect_spots.trackpy_local_max_peak_finder import TrackpyLocalMaxPeakFinder -from starfish.test.factories import ( +from starfish import ImageStack +from starfish.core.test.factories import ( two_spot_informative_blank_coded_data_factory, two_spot_one_hot_coded_data_factory, two_spot_sparse_coded_data_factory, ) from starfish.types import Axes, Features +from .._base import DetectSpotsAlgorithmBase +from ..blob import BlobDetector +from ..detect import detect_spots +from ..local_max_peak_finder import LocalMaxPeakFinder +from ..trackpy_local_max_peak_finder import TrackpyLocalMaxPeakFinder # verify all spot finders handle different coding types _, ONE_HOT_IMAGESTACK, ONE_HOT_MAX_INTENSITY = two_spot_one_hot_coded_data_factory() diff --git a/starfish/spots/_detect_spots/test/test_synthetic_data.py b/starfish/core/spots/_detect_spots/test/test_synthetic_data.py similarity index 95% rename from starfish/spots/_detect_spots/test/test_synthetic_data.py rename to starfish/core/spots/_detect_spots/test/test_synthetic_data.py index 20e24d22e..1fa1d40c5 100644 --- a/starfish/spots/_detect_spots/test/test_synthetic_data.py +++ b/starfish/core/spots/_detect_spots/test/test_synthetic_data.py @@ -1,9 +1,9 @@ import numpy as np import pytest -from starfish.spots._detect_spots.blob import BlobDetector -from starfish.test.factories import SyntheticData -from starfish.types import Axes, Features +from starfish.core.spots._detect_spots.blob import BlobDetector +from starfish.core.test.factories import SyntheticData +from starfish.core.types import Axes, Features def test_round_trip_synthetic_data(): diff --git a/starfish/spots/_detect_spots/trackpy_local_max_peak_finder.py b/starfish/core/spots/_detect_spots/trackpy_local_max_peak_finder.py similarity index 97% rename from starfish/spots/_detect_spots/trackpy_local_max_peak_finder.py rename to starfish/core/spots/_detect_spots/trackpy_local_max_peak_finder.py index de92dda0f..be3a53549 100644 --- a/starfish/spots/_detect_spots/trackpy_local_max_peak_finder.py +++ b/starfish/core/spots/_detect_spots/trackpy_local_max_peak_finder.py @@ -5,10 +5,10 @@ import xarray as xr from trackpy import locate -from starfish.imagestack.imagestack import ImageStack -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.types import Axes, SpotAttributes -from starfish.util import click +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.types import Axes, SpotAttributes +from starfish.core.util import click from ._base import DetectSpotsAlgorithmBase from .detect import detect_spots diff --git a/starfish/starfish.py b/starfish/core/starfish.py similarity index 91% rename from starfish/starfish.py rename to starfish/core/starfish.py index 4a2c80fab..c7ffa920d 100755 --- a/starfish/starfish.py +++ b/starfish/core/starfish.py @@ -6,21 +6,21 @@ import pkg_resources -from starfish.experiment.builder.cli import build as build_cli -from starfish.image import ( +from starfish.core.experiment.builder.cli import build as build_cli +from starfish.core.image import ( ApplyTransform, Filter, LearnTransform, Segment, ) -from starfish.spacetx_format.cli import validate as validate_cli -from starfish.spots import ( +from starfish.core.spacetx_format.cli import validate as validate_cli +from starfish.core.spots import ( AssignTargets, Decode, DetectPixels, DetectSpots, ) -from starfish.util import click +from starfish.core.util import click PROFILER_KEY = "profiler" diff --git a/starfish/types/test/__init__.py b/starfish/core/test/__init__.py similarity index 100% rename from starfish/types/test/__init__.py rename to starfish/core/test/__init__.py diff --git a/starfish/test/factories.py b/starfish/core/test/factories.py similarity index 98% rename from starfish/test/factories.py rename to starfish/core/test/factories.py index 664eb43da..b2d814f5c 100644 --- a/starfish/test/factories.py +++ b/starfish/core/test/factories.py @@ -7,10 +7,10 @@ from skimage import img_as_float32, img_as_uint from starfish import Codebook, ImageStack, IntensityTable -from starfish.image._filter.white_tophat import WhiteTophat -from starfish.imagestack.test.factories import create_imagestack_from_codebook -from starfish.spots._detect_spots.blob import BlobDetector -from starfish.types import Axes, Features +from starfish.core.image._filter.white_tophat import WhiteTophat +from starfish.core.imagestack.test.factories import create_imagestack_from_codebook +from starfish.core.spots._detect_spots.blob import BlobDetector +from starfish.core.types import Axes, Features class SyntheticData: @@ -22,7 +22,7 @@ class SyntheticData: Examples -------- - >>> from starfish.test.factories import SyntheticData + >>> from starfish.core.test.factories import SyntheticData >>> sd = SyntheticData(n_ch=3, n_round=4, n_codes=2) >>> codes = sd.codebook() diff --git a/starfish/test/test_profiler.py b/starfish/core/test/test_profiler.py similarity index 100% rename from starfish/test/test_profiler.py rename to starfish/core/test/test_profiler.py diff --git a/starfish/test/test_segmentation_mask.py b/starfish/core/test/test_segmentation_mask.py similarity index 95% rename from starfish/test/test_segmentation_mask.py rename to starfish/core/test/test_segmentation_mask.py index e7f518a3b..c455c4380 100644 --- a/starfish/test/test_segmentation_mask.py +++ b/starfish/core/test/test_segmentation_mask.py @@ -4,9 +4,11 @@ import pytest import xarray as xr -from starfish.segmentation_mask import (SegmentationMaskCollection, - validate_segmentation_mask) -from starfish.types import Axes, Coordinates +from starfish.core.segmentation_mask import ( + SegmentationMaskCollection, + validate_segmentation_mask, +) +from starfish.core.types import Axes, Coordinates def test_validate_segmentation_mask(): diff --git a/starfish/test/test_synthetic_spot_creation.py b/starfish/core/test/test_synthetic_spot_creation.py similarity index 88% rename from starfish/test/test_synthetic_spot_creation.py rename to starfish/core/test/test_synthetic_spot_creation.py index 2ea385e0e..8e46131d1 100644 --- a/starfish/test/test_synthetic_spot_creation.py +++ b/starfish/core/test/test_synthetic_spot_creation.py @@ -2,9 +2,9 @@ import pytest import xarray as xr -from starfish.intensity_table.test.factories import synthetic_intensity_table -from starfish.test.factories import synthetic_spot_pass_through_stack, SyntheticData -from starfish.types import Axes +from starfish.core.intensity_table.test.factories import synthetic_intensity_table +from starfish.core.test.factories import synthetic_spot_pass_through_stack, SyntheticData +from starfish.core.types import Axes def test_synthetic_spot_creation_raises_error_with_coords_too_small(): diff --git a/starfish/types/__init__.py b/starfish/core/types/__init__.py similarity index 100% rename from starfish/types/__init__.py rename to starfish/core/types/__init__.py diff --git a/starfish/types/_constants.py b/starfish/core/types/_constants.py similarity index 100% rename from starfish/types/_constants.py rename to starfish/core/types/_constants.py diff --git a/starfish/types/_decoded_spots.py b/starfish/core/types/_decoded_spots.py similarity index 93% rename from starfish/types/_decoded_spots.py rename to starfish/core/types/_decoded_spots.py index 33317ae54..e619e1b9a 100644 --- a/starfish/types/_decoded_spots.py +++ b/starfish/core/types/_decoded_spots.py @@ -1,6 +1,6 @@ import pandas as pd -from starfish.types import Coordinates, Features +from starfish.core.types import Coordinates, Features from ._validated_table import ValidatedTable diff --git a/starfish/types/_spot_attributes.py b/starfish/core/types/_spot_attributes.py similarity index 97% rename from starfish/types/_spot_attributes.py rename to starfish/core/types/_spot_attributes.py index ce35693db..d1e7d11a5 100644 --- a/starfish/types/_spot_attributes.py +++ b/starfish/core/types/_spot_attributes.py @@ -4,7 +4,7 @@ import numpy as np import pandas as pd -from starfish.types import Axes, Features +from starfish.core.types import Axes, Features from ._validated_table import ValidatedTable diff --git a/starfish/types/_validated_table.py b/starfish/core/types/_validated_table.py similarity index 100% rename from starfish/types/_validated_table.py rename to starfish/core/types/_validated_table.py diff --git a/starfish/intensity_table/test/test_to_expression_matrix.py b/starfish/core/types/test/__init__.py similarity index 100% rename from starfish/intensity_table/test/test_to_expression_matrix.py rename to starfish/core/types/test/__init__.py diff --git a/starfish/types/test/test_decoded_spots.py b/starfish/core/types/test/test_decoded_spots.py similarity index 89% rename from starfish/types/test/test_decoded_spots.py rename to starfish/core/types/test/test_decoded_spots.py index 6758e2b31..0aaf9ef6c 100644 --- a/starfish/types/test/test_decoded_spots.py +++ b/starfish/core/types/test/test_decoded_spots.py @@ -5,8 +5,8 @@ import pytest from starfish import IntensityTable -from starfish.codebook.test.factories import codebook_array_factory -from starfish.types import Coordinates, DecodedSpots, Features +from starfish.core.codebook.test.factories import codebook_array_factory +from starfish.core.types import Coordinates, DecodedSpots, Features def dummy_intensities() -> IntensityTable: diff --git a/starfish/core/util/__init__.py b/starfish/core/util/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/starfish/util/argparse.py b/starfish/core/util/argparse.py similarity index 100% rename from starfish/util/argparse.py rename to starfish/core/util/argparse.py diff --git a/starfish/util/click/__init__.py b/starfish/core/util/click/__init__.py similarity index 100% rename from starfish/util/click/__init__.py rename to starfish/core/util/click/__init__.py diff --git a/starfish/util/click/indirectparams.py b/starfish/core/util/click/indirectparams.py similarity index 91% rename from starfish/util/click/indirectparams.py rename to starfish/core/util/click/indirectparams.py index 379937b71..3040cd139 100644 --- a/starfish/util/click/indirectparams.py +++ b/starfish/core/util/click/indirectparams.py @@ -1,9 +1,9 @@ import abc from typing import Generic, Iterable, TypeVar -from starfish.codebook.codebook import Codebook -from starfish.imagestack.imagestack import ImageStack -from starfish.util.indirectfile import ( +from starfish.core.codebook.codebook import Codebook +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.util.indirectfile import ( ConversionFormula, convert, GetCodebook, diff --git a/starfish/util/click/test/test_help.py b/starfish/core/util/click/test/test_help.py similarity index 97% rename from starfish/util/click/test/test_help.py rename to starfish/core/util/click/test/test_help.py index 0049bbe25..4205e55b7 100644 --- a/starfish/util/click/test/test_help.py +++ b/starfish/core/util/click/test/test_help.py @@ -1,7 +1,7 @@ import subprocess import unittest -from starfish.util import exec +from starfish.core.util import exec def assert_contains(actual, expected): diff --git a/starfish/util/clock.py b/starfish/core/util/clock.py similarity index 100% rename from starfish/util/clock.py rename to starfish/core/util/clock.py diff --git a/starfish/util/config.py b/starfish/core/util/config.py similarity index 100% rename from starfish/util/config.py rename to starfish/core/util/config.py diff --git a/starfish/util/dtype.py b/starfish/core/util/dtype.py similarity index 100% rename from starfish/util/dtype.py rename to starfish/core/util/dtype.py diff --git a/starfish/util/enum.py b/starfish/core/util/enum.py similarity index 80% rename from starfish/util/enum.py rename to starfish/core/util/enum.py index acb9812a5..ce8bf37c6 100644 --- a/starfish/util/enum.py +++ b/starfish/core/util/enum.py @@ -1,6 +1,6 @@ from typing import Iterable, List, Union -from starfish.types import Axes +from starfish.core.types import Axes def harmonize(iterable: Iterable[Union[Axes, str]]) -> List[str]: return list(str(v) for v in iterable) diff --git a/starfish/util/exec.py b/starfish/core/util/exec.py similarity index 98% rename from starfish/util/exec.py rename to starfish/core/util/exec.py index c30b6f3ef..df9a96dc1 100644 --- a/starfish/util/exec.py +++ b/starfish/core/util/exec.py @@ -3,7 +3,7 @@ import tempfile from typing import Callable, Sequence, Union -from starfish.util import clock +from starfish.core.util import clock def stages(commands: Sequence[Sequence[Union[str, Callable]]], diff --git a/starfish/util/indirectfile/__init__.py b/starfish/core/util/indirectfile/__init__.py similarity index 100% rename from starfish/util/indirectfile/__init__.py rename to starfish/core/util/indirectfile/__init__.py diff --git a/starfish/util/indirectfile/_base.py b/starfish/core/util/indirectfile/_base.py similarity index 100% rename from starfish/util/indirectfile/_base.py rename to starfish/core/util/indirectfile/_base.py diff --git a/starfish/util/indirectfile/_codebook.py b/starfish/core/util/indirectfile/_codebook.py similarity index 76% rename from starfish/util/indirectfile/_codebook.py rename to starfish/core/util/indirectfile/_codebook.py index 1764903fa..67f432b3a 100644 --- a/starfish/util/indirectfile/_codebook.py +++ b/starfish/core/util/indirectfile/_codebook.py @@ -1,6 +1,6 @@ -from starfish.codebook.codebook import Codebook -from starfish.experiment.experiment import Experiment -from starfish.util.indirectfile._base import ConversionFormula +from starfish.core.codebook.codebook import Codebook +from starfish.core.experiment.experiment import Experiment +from starfish.core.util.indirectfile._base import ConversionFormula class GetCodebookFromExperiment(ConversionFormula): diff --git a/starfish/util/indirectfile/_imagestack.py b/starfish/core/util/indirectfile/_imagestack.py similarity index 81% rename from starfish/util/indirectfile/_imagestack.py rename to starfish/core/util/indirectfile/_imagestack.py index 22f9108b7..ea385cbb6 100644 --- a/starfish/util/indirectfile/_imagestack.py +++ b/starfish/core/util/indirectfile/_imagestack.py @@ -1,8 +1,8 @@ import re -from starfish.experiment.experiment import Experiment -from starfish.imagestack.imagestack import ImageStack -from starfish.util.indirectfile._base import ConversionFormula +from starfish.core.experiment.experiment import Experiment +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.util.indirectfile._base import ConversionFormula CRE = re.compile("@(?P.+)\[(?P[^\[\]]+)\]\[(?P[^\[\]]+)\]") # noqa: W605 diff --git a/starfish/util/logging.py b/starfish/core/util/logging.py similarity index 89% rename from starfish/util/logging.py rename to starfish/core/util/logging.py index 66043595a..0b42935ed 100644 --- a/starfish/util/logging.py +++ b/starfish/core/util/logging.py @@ -5,8 +5,8 @@ import pkg_resources -import starfish -from starfish.types import CORE_DEPENDENCIES +import starfish.core +from starfish.core.types import CORE_DEPENDENCIES @lru_cache(maxsize=1) @@ -24,9 +24,9 @@ def get_dependency_version(dependency: str) -> str: @lru_cache(maxsize=1) def get_release_tag() -> str: - if not starfish.__is_release_tag__: + if not starfish.core.is_release_tag: return "Running starfish from source" - return starfish.__is_release_tag__ + return starfish.core.is_release_tag @lru_cache(maxsize=1) diff --git a/starfish/util/try_import.py b/starfish/core/util/try_import.py similarity index 100% rename from starfish/util/try_import.py rename to starfish/core/util/try_import.py diff --git a/starfish/experiment/builder.py b/starfish/experiment/builder.py new file mode 100644 index 000000000..d7b20d23b --- /dev/null +++ b/starfish/experiment/builder.py @@ -0,0 +1,2 @@ +from starfish.core.experiment.builder import build_image, write_experiment_json # noqa: F401 +from starfish.core.experiment.builder.providers import FetchedTile, TileFetcher # noqa: F401 diff --git a/starfish/image.py b/starfish/image.py new file mode 100644 index 000000000..919132e90 --- /dev/null +++ b/starfish/image.py @@ -0,0 +1,6 @@ +from starfish.core.image import ( # noqa: F401 + ApplyTransform, + Filter, + LearnTransform, + Segment, +) diff --git a/starfish/spots.py b/starfish/spots.py new file mode 100644 index 000000000..3bacafa90 --- /dev/null +++ b/starfish/spots.py @@ -0,0 +1,6 @@ +from starfish.core.spots import ( # noqa: F401 + AssignTargets, + Decode, + DetectPixels, + DetectSpots, +) diff --git a/starfish/test/full_pipelines/api/test_allen_smFISH.py b/starfish/test/full_pipelines/api/test_allen_smFISH.py index b310c2f19..4511db1af 100644 --- a/starfish/test/full_pipelines/api/test_allen_smFISH.py +++ b/starfish/test/full_pipelines/api/test_allen_smFISH.py @@ -3,10 +3,8 @@ import starfish.data from starfish import FieldOfView -from starfish.image._filter.bandpass import Bandpass -from starfish.image._filter.clip import Clip -from starfish.image._filter.gaussian_low_pass import GaussianLowPass -from starfish.spots._detect_spots.trackpy_local_max_peak_finder import TrackpyLocalMaxPeakFinder +from starfish.image import Filter +from starfish.spots import DetectSpots @pytest.mark.skip('issues with checksums prevent this data from working properly') @@ -20,20 +18,20 @@ def test_allen_smFISH_cropped_data(): primary_image = experiment.fov().get_image(FieldOfView.PRIMARY_IMAGES) - clip = Clip(p_min=10, p_max=100) + clip = Filter.Clip(p_min=10, p_max=100) clipped_image = clip.run(primary_image, in_place=False) - bandpass = Bandpass(lshort=0.5, llong=7, threshold=None, truncate=4) + bandpass = Filter.Bandpass(lshort=0.5, llong=7, threshold=None, truncate=4) bandpassed_image = bandpass.run(clipped_image, in_place=False) - clip = Clip(p_min=10, p_max=100, is_volume=False) + clip = Filter.Clip(p_min=10, p_max=100, is_volume=False) clipped_bandpassed_image = clip.run(bandpassed_image, in_place=False) sigma = (1, 0, 0) # filter only in z, do nothing in x, y - glp = GaussianLowPass(sigma=sigma, is_volume=True) + glp = Filter.GaussianLowPass(sigma=sigma, is_volume=True) z_filtered_image = glp.run(clipped_bandpassed_image, in_place=False) - lmpf = TrackpyLocalMaxPeakFinder( + lmpf = DetectSpots.TrackpyLocalMaxPeakFinder( spot_diameter=3, min_mass=300, max_size=3, diff --git a/starfish/test/full_pipelines/cli/_base_cli_test.py b/starfish/test/full_pipelines/cli/_base_cli_test.py index cc76a6075..9cd77ae27 100644 --- a/starfish/test/full_pipelines/cli/_base_cli_test.py +++ b/starfish/test/full_pipelines/cli/_base_cli_test.py @@ -1,8 +1,8 @@ import os import shutil -from starfish.intensity_table.intensity_table import IntensityTable -from starfish.util import exec +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.util import exec class CLITest: diff --git a/starfish/test/full_pipelines/cli/test_allen_smFISH_cli.py b/starfish/test/full_pipelines/cli/test_allen_smFISH_cli.py index a7cdb106b..f0f0400cc 100644 --- a/starfish/test/full_pipelines/cli/test_allen_smFISH_cli.py +++ b/starfish/test/full_pipelines/cli/test_allen_smFISH_cli.py @@ -2,7 +2,7 @@ import sys import unittest -from starfish.test.full_pipelines.cli._base_cli_test import CLITest +from ._base_cli_test import CLITest @unittest.skip("skipping for now") diff --git a/starfish/test/full_pipelines/cli/test_dartfish_cli.py b/starfish/test/full_pipelines/cli/test_dartfish_cli.py index 143554eea..60c2255e9 100644 --- a/starfish/test/full_pipelines/cli/test_dartfish_cli.py +++ b/starfish/test/full_pipelines/cli/test_dartfish_cli.py @@ -6,8 +6,8 @@ import pytest from starfish import IntensityTable -from starfish.test.full_pipelines.cli._base_cli_test import CLITest from starfish.types import Features +from ._base_cli_test import CLITest EXPERIMENT_JSON_URL = "https://d2nhj9g34unfro.cloudfront.net/20181005/DARTFISH-TEST/experiment.json" diff --git a/starfish/test/full_pipelines/cli/test_iss.py b/starfish/test/full_pipelines/cli/test_iss.py index e092b4b60..c33849579 100644 --- a/starfish/test/full_pipelines/cli/test_iss.py +++ b/starfish/test/full_pipelines/cli/test_iss.py @@ -11,8 +11,8 @@ import pandas as pd import pytest -from starfish.test.full_pipelines.cli._base_cli_test import CLITest from starfish.types import Features +from ._base_cli_test import CLITest EXPERIMENT_JSON_URL = "https://d2nhj9g34unfro.cloudfront.net/20181005/ISS-TEST/experiment.json" diff --git a/starfish/test/full_pipelines/cli/test_merfish_cli.py b/starfish/test/full_pipelines/cli/test_merfish_cli.py index 79efe9ecb..b888a5f5c 100644 --- a/starfish/test/full_pipelines/cli/test_merfish_cli.py +++ b/starfish/test/full_pipelines/cli/test_merfish_cli.py @@ -2,7 +2,8 @@ import sys import unittest -from starfish.test.full_pipelines.cli._base_cli_test import CLITest +from ._base_cli_test import CLITest + @unittest.skip("skipping for now") class TestWithMerfishData(CLITest, unittest.TestCase): diff --git a/starfish/test/full_pipelines/recipe/_base_recipe_test.py b/starfish/test/full_pipelines/recipe/_base_recipe_test.py index 2d8e5e78a..e5b544eeb 100644 --- a/starfish/test/full_pipelines/recipe/_base_recipe_test.py +++ b/starfish/test/full_pipelines/recipe/_base_recipe_test.py @@ -3,7 +3,7 @@ from pathlib import Path from typing import Iterable, Optional -from starfish.util import exec +from starfish.core.util import exec class RecipeTest: diff --git a/starfish/test/full_pipelines/recipe/test_iss.py b/starfish/test/full_pipelines/recipe/test_iss.py index 92cb0ec99..b4fec70e6 100644 --- a/starfish/test/full_pipelines/recipe/test_iss.py +++ b/starfish/test/full_pipelines/recipe/test_iss.py @@ -13,7 +13,7 @@ import pandas as pd import pytest -from starfish.intensity_table.intensity_table import IntensityTable +from starfish import IntensityTable from starfish.types import Features from ._base_recipe_test import RecipeTest diff --git a/starfish/types.py b/starfish/types.py new file mode 100644 index 000000000..e3df8592b --- /dev/null +++ b/starfish/types.py @@ -0,0 +1,15 @@ +# constants +from starfish.core.types import ( # noqa: F401 + Axes, + Clip, + Coordinates, + CORE_DEPENDENCIES, + Features, + LOG, + OverlapStrategy, + PHYSICAL_COORDINATE_DIMENSION, + PhysicalCoordinateTypes, + STARFISH_EXTRAS_KEY, + TransformType, +) +from starfish.core.types import Number # noqa: F401 diff --git a/starfish/util/plot.py b/starfish/util/plot.py index f4782d4c1..a387ee85f 100644 --- a/starfish/util/plot.py +++ b/starfish/util/plot.py @@ -16,8 +16,9 @@ import xarray as xr from matplotlib.colors import ListedColormap -from starfish import ImageStack, IntensityTable -from starfish.types import Axes, Features +from starfish.core.imagestack.imagestack import ImageStack +from starfish.core.intensity_table.intensity_table import IntensityTable +from starfish.core.types import Axes, Features def imshow_plane(