Closed killianrochet closed 2 years ago
@killianrochet Now the structure of the conversion function looks good to me. Can you start filling the missing parts of the functions / add the missing conversion functions?
@JuliaSprenger Ok great, I wanted to have a first opinion on the general structure before doing all the fields! I'll continue with the implementation
@JuliaSprenger The test failed because i use a relative path right ? I'll change that as soon as possible. But i don't know if there are other errors
Yes, you still have hard coded paths of your system in the tests, that's why the tests are failing here.
@killianrochet None of the conversion does consider custom alignment options yet. According to your table (#60) this should correspond to a position
parameter in Elab. Could you add this to the conversions you implemented so far?
I think the next steps would be
@killianrochet Does this sound reasonable to you? Did I miss any step that is required in between?
@JuliaSprenger This is my only question. In redcap forms the custom alignment field is never used. I think this is because the redcap / csv management is better than the json management. So I was going to do a simple positioning with a single variable that increments at each iteration. Is there any specific rules I should consider?
In RedCap the custom alignment is the alignment of content within a field and does not affect the order of fields. To me it sounds like position
in elab is affecting the order of fields, right? In that case custom alignment
in RedCap and position
in Elab would not related to each other. @killianrochet Is this correct?
Hi @killianrochet, I refactored your code a bit and improved the usage of the regular expressions. Could you have a look at the changes I added to your branch? I think the tests should now also pass on github. :crossed_fingers:
@killianrochet If you have some time now or in two weeks you can have a look at the regular expressions I used and add some comments how these are working. I think this might be a good exercise to wrap your head around regexes.
@JuliaSprenger @SylvainTakerkart
Here is the first small version of the conversion of a csv file into a json file for elabFTW.
The idea is to have a conversion_csv_to_json() function which allows to get the csv file in order to convert it in a json format.
For the modification of types / attributes etc. The idea is to make several sub-functions. What would allow a better management thereafter. Example, a new type appears then one simply creates a new function instead of going to modify a large function of 500 lines.
I am working on the sub-functions, so that the changes are correct.
@JuliaSprenger small question, I would like to use a regex in my case statement to get all the @Default="" which corresponds to DefaultValue in json. But I have a type problem. Do you think it's because I give it json_df[i][j] as parameter?
I'll keep working on it, as I also need to change some of the positions etc. I'm doing some testing locally and on paper. I'm still working on it, I'll make regular commits for any progress, or code level question