Skip to content

improve generated code for import

Jonas Isensee requested to merge importimprovements into dev

This improves the generated code for loading vector export and scalar export.

Expected but missing fields (previously didn't exist or were @exportoffd) no longer error immediately. It is up to the constructor of the e.g. Particle type (or importconstruct) to implement a sensible default.

In addition to that this change improves load time with 20k particles by x5-20 locally for me.

This should make some of the fix_import functions obsolete.

This breaks the matching done in add_scalar_fallback. This could now be done in importconstruct or alternatively adapt the matching. add_vector_fallback will also no longer match. An importconstruct would be easiest e.g. InPartS.ExportUtils.importconstruct(t::Type{<:MotileCell}; ∫Fax=NaN, kwargs...) = t(; ∫Fax, kwargs...)

Compat with all cell models and fix_import will need to be ensured.

Edited by Jonas Isensee

Merge request reports