Skip to content

File naming/access in pyworkflow vs. Django vs. CLI #43

@reddigari

Description

@reddigari

Realized #42 was not the right place for this discussion, but this is a follow up on the comment I left there:

This is related to the first bug I worked around in #41 --- pyworkflow nodes need to know the absolute path of any files on disk, which were probably created with Django file storage. Obviously one fix (currently being used) is to use that API inside pyworkflow, but that's a separation of concerns issue (that would prevent us from using pyworkflow without the webserver entirely). My workaround in 21ae095 determines the absolute path from within the Django app, and passes it into the pyworkflow node factory. But I'm not sure whether that will work for all cases.

When we do deal with the CLI --- we could inject some filesystem abstraction into the pyworkflow.Workflow constructor. From the web app it would be Django's FileSystemStorage object, and for the CLI, it could be some custom wrapper of the user's filesystem (mounted in the Docker container? idk.) Then all files can be referred to by their with basenames, and pyworkflow can look them up in whatever filesystem it was given.

However, I'd say this complication is a point in favor of Diego's idea of having the CLI be a client of the Django app rather than of pyworkflow directly --- then everything can be done through the Django file storage API (although how the user will "upload" their data files when running in CLI mode is going to be tricky).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions