Open khoroshevskyi opened 10 months ago
actually, we should use class methods, like Project.from_pandas
and Project.from_pephub
, etc.
@donaldcampbelljr I think this may also be needed for your work using peppy's import
to implement the looper config embedded pep.
Yes, the issue I'm running into with https://github.com/pepkit/looper/issues/270:
So, my workaround to create a temp PEP, convert to a dict, update the dict with the Looper-modified values, and then initialize Peppy project from dict still does not work as desired because the re-initialization using _from_dict() does not handle all import/ammendments unlike the main initialization via a cfg file.
I really want to be able to do something like this:
import peppy
prj = peppy.Project.from_pephub("nsheff/mypep:default")
The peppy Project constructor was initially designed to expect a project in the form of a YAML+CSV file, a CSV file, or None. This approach was conceived before considering
peppy
as a dictionary or another Python representation.With the introduction of
Pephub
and other new packages, there is now a need to initialize the Project using alternative methods, such as pandas, dictionaries, YAML, etc. To accommodate this, we should restructure the__init__
method to accept three Python objects instead of a configuration (cfg
) string. For example: