Open kostyfisik opened 5 years ago
@szaghi What do you think? Is it a valid feature request?
@kostyfisik During this week I try to study this feature request, I am sorry for my delay.
@szaghi Thank you a lot! If you need more context you can check https://github.com/wave-scattering/amos-try/blob/master/cylinder2mod/model_parameters.f90#L57-L200
@kostyfisik
I have read more carefully this feature request. It is not simple, thus I have planned to implement it in gradual way: I first start to add a default value to the get
method and then I will try to implement the other modification, stay tuned.
@szaghi Note, that it was inspired by FLAP, it can be a good idea to keep it consistent for API names.
Note, that this feature request is about to reduce the boilerplate code needed to have some error proof behaiviour. While default
, and optional
keys seems to be natural, for error handling there can be some better API. I will add a check list to the first comment to make it easier to track gradual progress.
@szaghi Any update on this?
Hi @kostyfisik
I am very sorry, but I have not yet found the time for this issue, please be patient.
I think that the next two weeks are very busy, but I will hope to do it soon in the mid-Decemeber.
@szaghi Thank you a lot for your effort! I was able to get back to my project which uses FiNeR almost after 1 year of it being stalled due to various external reasons. This way mid-December looks to be a perfect time!
Summary:
default
keyoptional
keyDetailed description: In my code FiNeR usage looks to have a lot of boilerplate code and still no good error handling. Probably FiNeR can be improved some way to make the life of end users a bit easier. Now I have:
So, you can see a simple pattern: for every option in my INI file I use some default value, which I set before setting the one I get from FiNeR just to avoid the case of uninitialized variables. So it would be nice, if get() function had a default parameter, so I could reference to real argument only once and be sure that in case of any parsing error the variable would still be initialized with default value.
So, what about error handling? My code has no one at the moment to keep it maintainable. It would be nice if FiNeR can accumulate different types of error and just provide the report at the end. So at the end of calls to
fini%get(...)
I would like to do something likeFinally, it would be nice to separate required and optional options in INI file. E.g. if I call
it should not count an error if there is no
rl_min
option incylinder
section. However, it should count an error, if there was such an option and FiNeR could not parse it to requested variable type.