mdanalysis icon indicating copy to clipboard operation
mdanalysis copied to clipboard

Guessing a read attribute

Open aya9aladdin opened this issue 3 years ago • 3 comments

Is your feature request related to a problem?

continuing on the context-aware guesser project on #3753 I'm wondering what is the most suitable action to take if the user asked to guess an attribute already read from the file. there is a number of different scenarios that could happen:

1- just raise a warning that this attribute is already read and continue without guessing anything 2- raise a warning and direct the user if he/she actively wants to guess this attribute, they have to pass it to the force_guess parameter for example instead of the to_guess one 3- just guess it without warning

I want to hear your opinions regarding this point and which action is the optimum one

aya9aladdin avatar Aug 27 '22 02:08 aya9aladdin

Good summary of the problem and the listed solutions are pertinent.

I do prefer solution 2 but without raising a warning. Placing myself from a user point of view, if I run a script, I may need some attribute to be present regardless of the input file format. Therefore, I put all the attributes I need in to_guess to be sure they will be available in my universe. However, if they are read from the file, they are more reliable, so I should use that. No warning is warranted there, I think: the attribute will be available in my universe from a more reliable source, so quality is improved not reduced. I may have reasons to prefer the guessed attribute for some attributes. Either I know about issues in my input, or I need something different that is encoded in my context, or I need some homogeneity... Then I can force the guessing with force_guess.

Solution 2 with the warning is viable but will cause many warnings to be issued in legitimate cases. I like reducing the number of warnings; otherwise, users stop reading them.

Solution 1 is viable but closes some doors. It could work but 2 is better.

Solution 3 is a legitimate option to suggest but what is in the input file should always be preferred by default.

jbarnoud avatar Aug 27 '22 09:08 jbarnoud

That's what I was thinking about indeed

aya9aladdin avatar Aug 27 '22 17:08 aya9aladdin

I agree with @jbarnoud . (2) without warning. Instead, write the documentation clearly that guessing is only performed (1) if no information is available in the file, or (2) force_guess is used.

orbeckst avatar Aug 29 '22 16:08 orbeckst