-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
default and optional arguments for get(), combined error code #15
Comments
@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 |
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 |
@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 |
@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.The text was updated successfully, but these errors were encountered: