pace-neutrons / Horace

Horace is a suite of programs for the visualization and analysis of large datasets from time-of-flight neutron inelastic scattering spectrometers.
https://pace-neutrons.github.io/Horace/stable/
GNU General Public License v3.0
7 stars 4 forks source link

Hashing for unique-objects-container to use external MD5 function #1652

Closed cmarooney-stfc closed 3 months ago

cmarooney-stfc commented 3 months ago

Re Alex' comment

Well, almost there.
GetMD5.c should be removed as it is not used any more -- this is requests

Others are suggestions:

I would question using class as the wrapper for hasher and the initialization of Java engine in case of mex is used. As I understand, it is initialized anyway, regardless of mex beeing used or not and it is unnecessary.
You use persistent variable to hold java engine which means that class is not necessary -- everything can be placed within your hasher.
Though I am not sure we should keep build windows mex-es in the repository we still do. Some of them have been updated and new one have not been added. I think we should either add GetMD5.mex64 or remove all mexes.

GetMD5.c only kept until .cpp version known to work - now removed. mex file now added but let's remove them all systematically at some point engine initialization now made conditional on use_mex value In an ideal world Matlab would have class variables and we would not need to use persistent here. However, if we are going to separate hashing from unique_objects_container, as previously requested, then I prefer to have it in a class from the start as it provides growing room if this needs further modification e.g. for uses outside the unique containers.

abuts commented 3 months ago

I think it is only the beginning of the changes as you hasing serializable and this is unnecessary as fields for hash are the same. Hash should be build from values of the fields and be stored with object (hashable)