Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Remove element classes #1475

Draft
wants to merge 136 commits into
base: master
Choose a base branch
from
Draft

Conversation

kohr-h
Copy link
Member

@kohr-h kohr-h commented Feb 20, 2019

This is a WIP version of the more radical proposal in #1458. It's based on #1459 because that's the only reasonable base to start from.

Closes #1458
Closes #1249

TODO

Hard to know what exactly, will update along the way.

  • Remove NumpyTensor
  • Port useful code from __array_ufunc__ (space slicing / weight propagation) to NumpyTensorSpace Removed functions, beyond the scope of this PR. See ENH: Tensor-valued DiscreteLp #1238
  • Remove Tensor
  • Make Tensor.show a method of TensorSpace
  • Remove DiscreteLpElement
  • Make DiscreteLpElement.show a method of DiscreteLp
  • Move useful code from DiscreteLpElement to appropriate places
  • Remove ProductSpaceElement
  • Make ProductSpaceElement.show a method of ProductSpace
  • Turn product space weightings into functions and have ProductSpace invoke them directly (classes don't work any more since they use x1.space and the likes)
  • Turn all other weightings into functions
  • Remove LinearSpaceElement
  • Fix operators
  • Remove obsolete utility code
  • Clear documentation of references to removed classes

Passing Doctests

deform/
  • deform/linearized.py
set/
  • set/space.py
  • set/sets.py
  • set/domain.py
solvers/
  • solvers/smooth/newton.py
  • solvers/smooth/nonlinear_cg.py
  • solvers/smooth/gradient.py
  • solvers/functional/derivatives.py
  • solvers/functional/example_funcs.py
  • solvers/functional/functional.py
  • solvers/functional/default_functionals.py
  • solvers/util/steplen.py
  • solvers/util/callback.py
  • solvers/iterative/iterative.py
  • solvers/iterative/statistical.py
  • solvers/nonsmooth/difference_convex.py
  • solvers/nonsmooth/admm.py
  • solvers/nonsmooth/douglas_rachford.py
  • solvers/nonsmooth/alternating_dual_updates.py
  • solvers/nonsmooth/forward_backward.py
  • solvers/nonsmooth/proximal_operators.py
  • solvers/nonsmooth/proximal_gradient_solvers.py
  • solvers/nonsmooth/primal_dual_hybrid_gradient.py
ufunc_ops/
  • ufunc_ops/ufunc_ops.py
operator/
  • operator/oputils.py
  • operator/default_ops.py
  • operator/tensor_ops.py
  • operator/pspace_ops.py
  • operator/operator.py
trafos/
  • trafos/wavelet.py
  • trafos/fourier.py
  • trafos/backends/pyfftw_bindings.py
  • trafos/backends/pywt_bindings.py
  • trafos/util/ft_utils.py
diagnostics/
  • diagnostics/space.py
  • diagnostics/examples.py
  • diagnostics/operator.py
space/
  • space/base_tensors.py
  • space/entry_points.py
  • space/space_utils.py
  • space/pspace.py
  • space/weighting.py
  • space/npy_tensors.py
phantom/
  • phantom/noise.py
  • phantom/misc_phantoms.py
  • phantom/emission.py
  • phantom/geometric.py
  • phantom/transmission.py
  • phantom/phantom_utils.py
discr/
  • discr/diff_ops.py
  • discr/grid.py
  • discr/lp_discr.py
  • discr/discr_utils.py
  • discr/discr_ops.py
  • discr/partition.py
util/
  • util/graphics.py
  • util/normalize.py
  • util/numerics.py
  • util/npy_compat.py
  • util/utility.py
  • util/testutils.py
  • util/pytest_config.py
  • util/vectorization.py
tomo/
  • tomo/analytic/filtered_back_projection.py
  • tomo/backends/skimage_radon.py
  • tomo/backends/astra_cpu.py
  • tomo/backends/astra_cuda.py
  • tomo/backends/astra_setup.py
  • tomo/geometry/geometry.py
  • tomo/geometry/conebeam.py
  • tomo/geometry/detector.py
  • tomo/geometry/spect.py
  • tomo/geometry/parallel.py
  • tomo/util/utility.py
  • tomo/util/testutils.py
  • tomo/operators/ray_trafo.py
contrib/
  • contrib/tensorflow/space.py
  • contrib/tensorflow/layer.py
  • contrib/tensorflow/operator.py
  • contrib/shearlab/shearlab_operator.py
  • contrib/solvers/spdhg/misc.py
  • contrib/solvers/spdhg/stochastic_primal_dual_hybrid_gradient.py
  • contrib/solvers/functional/nonlocalmeans_functionals.py
  • contrib/datasets/util.py
  • contrib/datasets/ct/fips.py
  • contrib/datasets/ct/mayo_dicom_dict.py
  • contrib/datasets/ct/mayo.py
  • contrib/datasets/mri/tugraz.py
  • contrib/datasets/images/cambridge.py
  • contrib/pyshearlab/pyshearlab_operator.py
  • contrib/param_opt/param_opt.py
  • contrib/fom/unsupervised.py
  • contrib/fom/supervised.py
  • contrib/fom/util.py
  • contrib/torch/operator.py
  • contrib/torch/test/test_operator.py
  • contrib/mrc/mrc.py
  • contrib/mrc/uncompr_bin.py
  • contrib/tomo/elekta.py

Passing Unittests

test/deform/
  • test/deform/linearized_deform_test.py
test/set/
  • test/set/sets_test.py
  • test/set/domain_test.py
  • test/set/space_test.py
test/largescale/
  • test/largescale/solvers/nonsmooth/default_functionals_slow_test.py
  • test/largescale/trafos/fourier_slow_test.py
  • test/largescale/space/tensor_space_slow_test.py
  • test/largescale/tomo/analytic_slow_test.py
  • test/largescale/tomo/ray_transform_slow_test.py
test/solvers/
  • test/solvers/smooth/smooth_test.py
  • test/solvers/functional/functional_test.py
  • test/solvers/functional/default_functionals_test.py
  • test/solvers/util/steplen_test.py
  • test/solvers/iterative/iterative_test.py
  • test/solvers/nonsmooth/primal_dual_hybrid_gradient_test.py
  • test/solvers/nonsmooth/douglas_rachford_test.py
  • test/solvers/nonsmooth/alternating_dual_updates_test.py
  • test/solvers/nonsmooth/proximal_utils_test.py
  • test/solvers/nonsmooth/proximal_operator_test.py
  • test/solvers/nonsmooth/admm_test.py
  • test/solvers/nonsmooth/forward_backward_test.py
  • test/solvers/nonsmooth/difference_convex_test.py
test/operator/
  • test/operator/pspace_ops_test.py
  • test/operator/tensor_ops_test.py
  • test/operator/operator_test.py
  • test/operator/oputils_test.py
test/trafos/
  • test/trafos/wavelet_test.py
  • test/trafos/fourier_test.py
  • test/trafos/backends/pyfftw_bindings_test.py
  • test/trafos/backends/pywt_bindings_test.py
  • test/trafos/util/ft_utils_test.py
test/space/
  • test/space/tensors_test.py
  • test/space/space_utils_test.py
  • test/space/pspace_test.py
test/discr/
  • test/discr/discr_ops_test.py
  • test/discr/grid_test.py
  • test/discr/discr_utils_test.py
  • test/discr/lp_discr_test.py
  • test/discr/partition_test.py
  • test/discr/diff_ops_test.py
test/util/
  • test/util/numerics_test.py
  • test/util/normalize_test.py
  • test/util/vectorization_test.py
  • test/util/utility_test.py
test/tomo/
  • test/tomo/backends/astra_cuda_test.py
  • test/tomo/backends/skimage_test.py
  • test/tomo/backends/astra_cpu_test.py
  • test/tomo/backends/astra_setup_test.py
  • test/tomo/geometry/geometry_test.py
  • test/tomo/geometry/spect_geometry_test.py
  • test/tomo/operators/ray_trafo_test.py
contrib/*/test/
  • contrib/tensorflow/test/tensorflow_test.py
  • contrib/shearlab/test/operator_test.py
  • contrib/pyshearlab/test/operator_test.py
  • contrib/param_opt/test/test_param_opt.py
  • contrib/fom/test/test_unsupervised.py
  • contrib/fom/test/test_supervised.py
  • contrib/mrc/test/uncompr_bin_test.py
  • contrib/mrc/test/mrc_test.py

Working Examples

deform/
  • deform/linearized_fixed_displacement.py
  • deform/linearized_fixed_template.py
solvers/
  • solvers/pdhg_tomography_tgv.py
  • solvers/lbfgs_tomography_tv.py
  • solvers/douglas_rachford_pd_tomography_tv.py
  • solvers/kaczmarz_tomography.py
  • solvers/pdhg_denoising_ROF_algorithm_comparison.py
  • solvers/pdhg_denoising_L1_HuberTV.py
  • solvers/lbfgs_tomography.py
  • solvers/functional_basic_example.py
  • solvers/proximal_gradient_wavelet_tomography.py
  • solvers/forward_backward_pd_denoising.py
  • solvers/admm_tomography.py
  • solvers/pdhg_denoising.py
  • solvers/nuclear_norm_tomography.py
  • solvers/pdhg_denoising_L2_HuberTV.py
  • solvers/nuclear_norm_minimization.py
  • solvers/proximal_lang_poisson.py
  • solvers/scipy_solvers.py
  • solvers/denoising_with_entropy_type_regularization.py
  • solvers/bregman_tv_tomography.py
  • solvers/conjugate_gradient_tomography.py
  • solvers/adupdates_tomography.py
  • solvers/douglas_rachford_pd_mri.py
  • solvers/proximal_gradient_denoising.py
  • solvers/pdhg_deconvolve.py
  • solvers/proximal_lang_tomography.py
  • solvers/pdhg_denoising_tgv.py
  • solvers/deconvolution_1d.py
  • solvers/pdhg_denoising_complex.py
  • solvers/rosenbrock_minimization.py
  • solvers/functional_basic_example_solver.py
  • solvers/douglas_rachford_pd_heron.py
  • solvers/pdhg_tomography.py
ufunc_ops/
  • ufunc_ops/ufunc_composition.py
  • ufunc_ops/ufunc_basics.py
  • ufunc_ops/ufunc_solvers.py
operator/
  • operator/simple_operator.py
  • operator/convolution_operator.py
trafos/
  • trafos/fourier_trafo.py
  • trafos/wavelet_trafo.py
diagnostics/
  • diagnostics/diagonstics_space.py
space/
  • space/simple_r.py
  • space/simple_rn.py
  • space/vectorization.py
tomo/
  • tomo/filtered_backprojection_cone_2d.py
  • tomo/ray_trafo_parallel_2d.py
  • tomo/ray_trafo_cone_3d.py
  • tomo/ray_trafo_parallel_3d_euler.py
  • tomo/filtered_backprojection_cone_3d_short_scan.py
  • tomo/filtered_backprojection_helical_3d.py
  • tomo/filtered_backprojection_cone_2d_short_scan.py
  • tomo/filtered_backprojection_parallel_2d_complex.py
  • tomo/anisotropic_voxels.py
  • tomo/ray_trafo_parallel_3d.py
  • tomo/filtered_backprojection_parallel_2d.py
  • tomo/filtered_backprojection_parallel_3d.py
  • tomo/ray_trafo_cone_2d.py
  • tomo/ray_trafo_parallel_2d_complex.py
  • tomo/filtered_backprojection_cone_3d.py
  • tomo/ray_trafo_helical_cone_3d.py
  • tomo/checks/check_axes_parallel3d_bp.py
  • tomo/checks/check_axes_cone3d_fp.py
  • tomo/checks/check_axes_parallel2d_bp.py
  • tomo/checks/check_axes_parallel2d_fp.py
  • tomo/checks/check_axes_cone3d_bp.py
  • tomo/checks/check_axes_parallel3d_fp.py
  • tomo/checks/check_axes_cone2d_fp.py
  • tomo/checks/check_axes_cone2d_bp.py
  • tomo/backends/astra_performance_cpu_parallel_2d_cg.py
  • tomo/backends/astra_performance_cuda_cone_3d_cg.py
  • tomo/backends/astra_performance_cuda_parallel_2d_cg.py
visualization/
  • visualization/visualize_vector_examples.py ->visualization/show_examples.py
  • visualization/show_productspace.py
  • visualization/show_update_1d.py
  • visualization/show_2d_complex.py
  • visualization/show_update_2d.py
  • visualization/show_1d.py
  • visualization/show_2d.py
  • visualization/show_vector.py
  • visualization/show_callback.py
  • visualization/show_update_in_place_2d.py
contrib/*/examples/
  • contrib/tensorflow/examples/tensorflow_layer_matrix.py
  • contrib/tensorflow/examples/tensorflow_layer_productspace.py
  • contrib/tensorflow/examples/tensorflow_tomography.py
  • contrib/tensorflow/examples/tensorflow_layer_ray_transform.py
  • contrib/tensorflow/examples/tensorflow_operator_matrix.py
  • contrib/shearlab/examples/wave_shear_separation.py
  • contrib/shearlab/examples/basic_shearlab.py
  • contrib/solvers/spdhg/examples/PET_1k.py
  • contrib/solvers/spdhg/examples/deblurring_1k2_dual.py
  • contrib/solvers/spdhg/examples/PET_linear_rate.py
  • contrib/solvers/spdhg/examples/ROF_1k2_primal.py
  • contrib/solvers/spdhg/examples/get_started.py
  • contrib/solvers/examples/tomography_nonlocalmeans.py
  • contrib/datasets/ct/examples/mayo_reconstruct.py
  • contrib/datasets/ct/examples/fips_reconstruct.py
  • contrib/datasets/mri/examples/tugraz_reconstruct.py
  • contrib/datasets/images/examples/cambridge_images.py
  • contrib/pyshearlab/examples/wave_shear_separation.py
  • contrib/pyshearlab/examples/basic_shearlab.py
  • contrib/param_opt/examples/find_optimal_parameters.py
  • contrib/fom/examples/noise_power_spectrum.py
  • contrib/fom/examples/haarpsi.py
  • contrib/fom/examples/supervised_comparison.py
  • contrib/torch/examples/operator_module.py
  • contrib/torch/examples/operator_autograd.py
  • contrib/mrc/examples/mrc_io.py
  • contrib/mrc/examples/raw_binary_with_header_io.py
  • contrib/tomo/examples/elekta_icon_fbp.py
  • contrib/tomo/examples/elekta_xvi_algebraic_reconstruction.py
  • contrib/tomo/examples/elekta_xvi_fbp.py
  • contrib/tomo/examples/elekta_icon_algebraic_reconstruction.py

@pep8speaks
Copy link

pep8speaks commented Feb 21, 2019

Checking updated PR...

Line 477:39: E225 missing whitespace around operator
Line 9:1: E302 expected 2 blank lines, found 1

Line 1072:80: E501 line too long (80 > 79 characters)
Line 634:80: E501 line too long (86 > 79 characters)
Line 628:80: E501 line too long (86 > 79 characters)

Line 317:1: E303 too many blank lines (3)

Line 1825:5: E303 too many blank lines (2)
Line 1679:80: E501 line too long (80 > 79 characters)
Line 1588:80: E501 line too long (88 > 79 characters)
Line 1486:80: E501 line too long (88 > 79 characters)

Line 697:5: E303 too many blank lines (2)
Line 652:5: E303 too many blank lines (2)

Line 676:45: E231 missing whitespace after ','
Line 676:44: E203 whitespace before ','

Comment last updated at 2019-03-21 23:13:40 UTC

@kohr-h kohr-h force-pushed the remove_element branch 3 times, most recently from 409ae01 to 34f8be0 Compare February 23, 2019 19:30
@kohr-h kohr-h force-pushed the remove_element branch 2 times, most recently from 5ffe090 to a188aa8 Compare March 13, 2019 21:17
@kohr-h kohr-h changed the base branch from remove_fspace to master April 2, 2020 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Element classes!? Change space_elem == other behavior?
2 participants