We are still doing a fair amount of refactoring, and a side-effect of this is that application scripts will frequently be affected by this. For example, atm lfric does not compile with PSyclone master anymore because OMPParallelTrans was moved.
In Fab, I have recently introduced an api module (ok, maybe we should call it psyclone_interface ??) - basically, in this module we import the required (all?) PSyclone modules, classes, functions, ... that applications need.
Any application would then just do: from psyclone.psyclone_interface import whatever, this, script, needs . If we move a class/module around, all we need to do is update this psyclone_interface module, but no user script would need to be modified. It also helped us significantly to reduce cyclic dependencies (we removed all imports in __init__.py scripts - anything in fab needs to use the full path). Disadvantage: this psyclone_interface file will likely import a lot more function which not all scripts will use (e.g. I would assume that if we use LFRic, we will never actually import gocean-specific modules). Maybe we could use three interfaces (generic, lfric, gocean)??
Not sure if it's still worth doing this though (e.g. the above error is currently restricted to a single psyclone_tools class in LFRic, so a single line change). With Fab we are only starting to push scripts into the git repositories, so it's actually still a good time to do this.
Any opinion, @sergisiso, @arporter , @LonelyCat124 ?
We are still doing a fair amount of refactoring, and a side-effect of this is that application scripts will frequently be affected by this. For example, atm lfric does not compile with PSyclone master anymore because
OMPParallelTranswas moved.In Fab, I have recently introduced an
apimodule (ok, maybe we should call itpsyclone_interface??) - basically, in this module we import the required (all?) PSyclone modules, classes, functions, ... that applications need.Any application would then just do:
from psyclone.psyclone_interface import whatever, this, script, needs. If we move a class/module around, all we need to do is update thispsyclone_interfacemodule, but no user script would need to be modified. It also helped us significantly to reduce cyclic dependencies (we removed all imports in__init__.pyscripts - anything in fab needs to use the full path). Disadvantage: thispsyclone_interfacefile will likely import a lot more function which not all scripts will use (e.g. I would assume that if we use LFRic, we will never actually import gocean-specific modules). Maybe we could use three interfaces (generic, lfric, gocean)??Not sure if it's still worth doing this though (e.g. the above error is currently restricted to a single
psyclone_toolsclass in LFRic, so a single line change). With Fab we are only starting to push scripts into the git repositories, so it's actually still a good time to do this.Any opinion, @sergisiso, @arporter , @LonelyCat124 ?