nfdi4plants / ARCCommander

Tool to manage your ARCs
MIT License
11 stars 9 forks source link

[Discussion] Adding assay with existing name registers this assay additionally to a new study #211

Closed micwij closed 9 months ago

micwij commented 11 months ago

Describe the bug When trying to describe the error in #210 I accidentally created another assay with the same assay name but did not provide a study name. While arc commander does recognize that an assay folder with that name exists it still partially executes the command and registers the existing assay to a new study.

To Reproduce

arc init arc i create --identifier Test_investigation arc s add -identifier Test_study arc a add -s Test_study -a Test_assay

arc a add -a Test_assay

Start Assay Init ERROR: Assay folder with identifier Test_assay already exists. Start Assay Register Study with the identifier Test_assay does not exist yet, creating it now. Done processing command.

arc a list

Start processing parameterless command.

Start Assay List Study: Test_study --Assay: Test_assay Study: Test_assay --Assay: Test_assay Done processing command.

Expected behavior

I would expect the command to be aborted and I am wondering, whether we want this behavior.

OS and framework information (please complete the following information):

Additional context Unless this is in conflict with general isa specifications, I do think it is good though to be able to register one assay to multiple studies (e.g. you collect samples from several studies and perform one assay with all of them).

HLWeil commented 10 months ago

Hey, thanks for your input. Was just about to fix this issue when I also asked myself this question:

I would expect the command to be aborted and I am wondering, whether we want this behavior.

Of course the whole create study when no identifier is given thing is a bit of a convenience feature, that one wouldn't necessarily expect. But following the two scenarios

  1. assay add with no study identifier -> create assay and study from assay identifier
  2. assay add with study identifier but assay already existing -> register assay to study (create new if non-existing)

... assay add with no study identifier but assay already existing -> register assay to study (create new if non-existing from assay identifier) kind of makes sense

HLWeil commented 10 months ago

So not sure whether I should actually abide from the as-is logic

micwij commented 10 months ago

... assay add with no study identifier but assay already existing -> register assay to study (create new if non-existing from assay identifier) kind of makes sense

I see your point. You are right, it makes sense. I was just thinking that there could be warning and the user could be asked if he wants to continue, but this probably anyway only occurs by mistake, like it happened to me.

HLWeil commented 9 months ago

Alright, so closing this for now. Feel free to reopen if necessary.