pyiron / pyiron_workflow

Graph-and-node based workflows
BSD 3-Clause "New" or "Revised" License
14 stars 1 forks source link

Change: No more working directory #401

Closed liamhuber closed 3 months ago

liamhuber commented 3 months ago

Right now nodes use pyiron_snippets.files to automatically generate their own .working_directory based on their semantic path. This gets used in saving and (automatic-)loading.

This has some nasty interactions with macros (#316) and the current way I use it to look at directories and remove them when empty is super un-performant (conversations with @pmrv and local tests), but overall is running fine.

In practice, we like to decompose file-based stuff into macros where different stages are treated individually, e.g. WriteInput, RunExe, ReadOutput, each of which needs to know about the same working directory. In this case it makes much more sense for working directories to be some external input rather than leaning on the directory of each node, since all three want the same directory. So one of the key use-cases for a Node.working_directory is just not panning out as well as hoped.

What I'd like to do (for now at least) is to just get rid of the property. I don't have any objection to using pyiron_snippets.files, e.g. inside .save calls, I just don't want to be auto-populating a new directory on each node instance.

@samwaseda you are my files guy, thoughts?

@ligerzero-ai @Tara-Lakshmipathy, you've both been developing nodes -- would you miss the .working_directory property if it disappeared? Are there any related features you wish were available?

ligerzero-ai commented 3 months ago

I think it's far more natural for the user to specify if a node needs to have a working directory as a property.

So no, I won't miss it.