JuliaPhysics/SolidStateDetectors.jl

Clean up: remove obsolete functions

fhagemann opened this issue · 9 comments

Some of the functions are still left over from refactoring the JSON files.

One example is the bounding_box function, which returns the crystal_radius and crystal_length which is no longer stored in SolidStateDetector.

Also, we should look for functions that are defined but never called, e.g. from_internal_units.

These functions should be either removed or incorporated accordingly.

lmh91 commented

Yes, from_internal_units is not really used or just at some points.
At the beginning we did not used Unitful.jl that much.
But we should for external functions. Internally we should convert all the units to SI units using to_internal_units
and afterwards return the output in the units corresponding to the given input units via from_internal_units.

This addresses for example the simulation of events, see #66.

How important are the functions get_important_points for the volume primitives?
Apparently, they were used to adapt the grid to the volumes before implementing the painting algorithm.
Are they still required?

lmh91 commented

They are extremely important.

I came across two functions that are not used and, thus, obsolete (please confirm!)

The function _drift_charge(...) in ChargeDrift.jl line 60 seems to be an internal function but is never called. Is it obsolete?

All it does is to put the starting position in a vector and call the _drift_charges(...) function. Basically, the application would be to call the function for a single starting position, warranting the singular, which can be a legit argument for user friendliness. This is an internal function though, so as far as I am concerned it can go.

I have created a new cleanup branch that we should use to remove obsolete functions and add docstrings to all (exported) functions that remain.

lmh91 commented

I think this can be actually closed, right?

Yes, I will close this.