klaundal / lompe

MIT License
15 stars 8 forks source link

The save/load function issues #38

Closed BingMM closed 3 months ago

BingMM commented 5 months ago

The FACs are not the same when produced from a model before and after it has been saved/loaded.

klaundal commented 5 months ago

@08walkersj any thoughts on this?

08walkersj commented 5 months ago

I will need to have a little check but if the differences are small then the likely cause is that the FACs are being recalculated using the loaded model object and the conductance is the issue. The conductance in lompe is a function and thus is not simple to save. The current save/load functionality will save the conductance on a grid and then use 2d linear interpolation to create the conductance function upon load.

klaundal commented 4 months ago

I think the best fix for this is to change how we set the conductance. We now require a function, but in reality we (almost) always evaluate on the grids, so it would make sense to have an option to provide values on the grids instead of a function. Then, if a function is provided, we evaluate on the grids and save those values.

We should be a bit careful in making this change in order to make it backwards compatible. I guess it's not urgent...

08walkersj commented 3 months ago

Then this is going to be a change in the model first and then changing the model save/load functionality.

klaundal commented 3 months ago

I don't think this should be a priority actually. I think that the way that you do it now, with interpolating from a regular grid, sounds like the best solution given that the code requires a function. I'm closing the issue, feel free to reopen if you disagree.