agencyenterprise / neurotechdevkit

Neurotech Development Kit (NDK)
https://agencyenterprise.github.io/neurotechdevkit/
Apache License 2.0
117 stars 10 forks source link

134 Slice `SteadyStateResult3D` to `SteadyStateResult2D` #147

Closed kylmcgr closed 1 year ago

kylmcgr commented 1 year ago

Introduction

https://github.com/agencyenterprise/neurotechdevkit/issues/134 This PR adds the get_steady_state_result_2d method to the SteadyStateResult3D class to be able to convert the SteadyStateResult3D output of a 3-D simulation to a SteadyStateResult2D that just encapsulates the slice of interest.

Changes

The get_steady_state_result_2d method with optional arguments of slice_axis and slice_position (the slice_axis and slice_position property of the 3D result is used when none is given) is added to the SteadyStateResult3D class in _results.py. The method _validate_slice_args is also added to SteadyStateResult3D to check the slice being made. The SteadyStateResult2D object returned by the get_steady_state_result_2d method has the target and sources removed (should be changed to the correctly sliced target and sources in https://github.com/agencyenterprise/neurotechdevkit/issues/148); warnings for missing target/sources are added to the rendering and metrics of SteadyStateResult2D. Moved definition of SliceAxis enum from _base.py to _utils.py, so the get_steady_state_result_2d method can be typed.

Behavior

The new behavior is the generation of a 2D steady-state result object from a 3D steady-state result object by the get_steady_state_result_2d method of the SteadyStateResult3D class. This can be tested by making a 3D steady-state result and calling the method to generate a 2D slice of that result.

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage is 85.50% of modified lines.

Files Changed Coverage
src/neurotechdevkit/results/_results.py 78.72%
src/neurotechdevkit/scenarios/__init__.py 100.00%
src/neurotechdevkit/scenarios/_base.py 100.00%
src/neurotechdevkit/scenarios/_utils.py 100.00%
.../neurotechdevkit/scenarios/built_in/_scenario_0.py 100.00%
.../neurotechdevkit/scenarios/built_in/_scenario_1.py 100.00%
.../neurotechdevkit/scenarios/built_in/_scenario_2.py 100.00%

:loudspeaker: Thoughts on this report? Let us know!.