You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The file structure in PorePy make extensive use of folders and subfolders, organized in a semi-logical way. To facilitate easy access to classes and modules, __ init __-files are used to enable, for instance pp.Mpfa as an alias for pp.numerics.fv.mpfa.Mpfa. While this by itself is a sound approach that we in the main would like to keep, it also has several shortcomings:
The current use of __ init __ is top-down, in the sense that the top-level __ init __ fetches individual functions and classes. An alternative approach, which may be more pythonic, is to iteratively use sub-package __ inits __ together with the keyword __ all __, to build the structure bottom-up. An experiment in this direction can be found in pp.numerics.ad and its associated modules. It is unclear what is the best way of doing this, and whether it makes sense to strive for 'best' or just 'this works', but a principled approach based on some research into pros and cons is lacking.
There is no policy on what are private and public classes and modules, in the pythonic sense. Nor do we have a way to mark this in the code, e.g. by letting private modules have names starting with an underscore and/or be included in an __ all __ statement/import in __ init __. While there may be several acceptable approaches here, it is tempting to wish for a scheme which forces the developer to explicitly consider if a new function, class, or method is public or not, and similarly informs the user.
If we get a solution for the above points, it is natural to let all public classes be acceptable through pp.ClassName, all public modules as pp.module_name. What to do with individual functions is not crystal clear, but may become so with considering a few cases.
There may be more to this, we should amend the issue as things become clearer.
The text was updated successfully, but these errors were encountered:
The file structure in PorePy make extensive use of folders and subfolders, organized in a semi-logical way. To facilitate easy access to classes and modules, __ init __-files are used to enable, for instance
pp.Mpfa
as an alias forpp.numerics.fv.mpfa.Mpfa
. While this by itself is a sound approach that we in the main would like to keep, it also has several shortcomings:pp.numerics.ad
and its associated modules. It is unclear what is the best way of doing this, and whether it makes sense to strive for 'best' or just 'this works', but a principled approach based on some research into pros and cons is lacking.pp.ClassName
, all public modules aspp.module_name
. What to do with individual functions is not crystal clear, but may become so with considering a few cases.There may be more to this, we should amend the issue as things become clearer.
The text was updated successfully, but these errors were encountered: