Campbell-Muscle-Lab / PyMyoVent

PyMyoVent is computer code that simulates an idealized ventricle pumping blood around a single circulation.
http://Campbell-Muscle-Lab.github.io/PyMyoVent/index.html
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

What is the best format of the instruction JSON file? #11

Closed HosseinSharifii closed 3 years ago

HosseinSharifii commented 4 years ago

Obviously, in order to have a robust and user-friendly PyMyoVent package we need to have:

1- A robust source code in which an individual user does not need to change anything from the code. 2- A comprehensive instruction file that the user a) only needs to change the parameters values and b) avoid the user from adding or removing sections from the JSON file.

Definitely dealing of a new user with JSON format files would not be easy (or too easy). Therefore, to avoid him/her from getting into trouble I believe the instruction file must be developed in a way that brings the possibility of making mistakes to zero.

To a non-expert user, adding or removing different sections from the instruction file would be cumbersome and can put them into troubles. Hence, I imagine the easiest way for him/her is to control different sections with boolean switch control (false/true) or by changing the "section_scheme_name" if it is needed.

For example, if the user wants to change the system_control method from "fixed_heart_rate" to the "simple_baroreceptor", he/she needs only change the "scheme" and change the parameters values if it is required, instead of removing the the "fixed_heart_rate" section and then adding the new section for the baroreceptor.

That is also true for other sections/modules like perturbation, growth, MyoSim membrane class, and etc!

For sure, I would appreciate any argument on this.

"baroreflex": { "baro_scheme": ["fixed_heart_rate"], "fixed_heart_rate":{ "simulation":{ "no_of_time_points": [17000], "time_step": [0.001], "duty_ratio": [0.003], "basal_heart_period": [1,"s"] } }, "simple_baroreceptor":{ "simulation":{ "start_index":[2000], "memory":[2,"s"], "no_of_time_points": [150000], "time_step": [0.001], "duty_ratio": [0.003], "basal_heart_period": [1,"s"] }, "afferent": { "b_max": [2], "b_min": [0], "S": [0.067,"mmHg"], "P_n": [90,"mmHg"] }, "regulation":{ "heart_period":{ "G_T": [0.03] }, "k_1":{ "G_k1": [-0.05] }, "k_on":{ "G_k_on":[0.02] }, "ca_uptake":{ "G_up": [-0.02] }, "g_cal":{ "G_gcal": [-0.03] } } } },

kenatcampbellmusclelab commented 4 years ago

@HosseinGit - I think we should video chat about this. Do you want to set up a meeting?

My first thought is that it is easier to omit sections that don't do anything. For example, if there is no perurbation, we don't need a section that says, "no perturbation".

I was thinking the same for the baroreceptor - fixed heart rate = no baroreceptor, but then I realized that you could have no chronotropism but still a change in contractility. In that case, I would say omit the baroreceptor section if there is no control and omit the heart-period factor if there is contractility but no chronotropism. Do you see the way I think about it?

In essence, I'm saying parameters are 0 unless specified otherwise. I think you are planning to specify all parameters. I think that seems like a good idea until you want to add a new feature further down the road and need to update all your old instruction files.

HosseinSharifii commented 4 years ago

@kenatcampbellmusclelab -Thanks foe sharing your thoughts. I will set up a meeting for the next week on Teams.

HosseinSharifii commented 3 years ago

This was discussed and we came up with the solution. I am closing this issue.