docs: Context and Storage#712
docs: Context and Storage#712ethanholz wants to merge 18 commits intoOpenFreeEnergy:feat/warehousefrom
Conversation
Signed-off-by: Ethan Holz <ethan.holz@omsf.io>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/warehouse #712 +/- ##
=================================================
Coverage ? 98.33%
=================================================
Files ? 42
Lines ? 2526
Branches ? 0
=================================================
Hits ? 2484
Misses ? 42
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Alyssa Travitz <31974495+atravitz@users.noreply.github.com>
This adds new information on how storage is handled, and how storage gets passed around by units.
|
One thing that is clearly missing here is an update to the Protocol How-To, is this work that someone on the OpenFE side would like to tackle? I am more than happy to assist but I think it might be a good exercise in knowledge transfer. |
@IAlibay is the person to sync with on this |
Co-authored-by: Alyssa Travitz <31974495+atravitz@users.noreply.github.com>
|
We are in the home stretch, do we want to have @IAlibay take a look as well? |
| This means each ``ProtocolUnit``'s ``shared`` and ``permanent`` object are not paths, and should not be treated as such. | ||
| Both of these are registries that track if a file should be transferred from its location in ``scratch`` to its final location after completing a unit. | ||
|
|
||
| If you want to use some from ``shared`` or ``permanent``, you can use ``ctx.shared.load`` or ``ctx.permanent.load``. |
There was a problem hiding this comment.
| If you want to use some from ``shared`` or ``permanent``, you can use ``ctx.shared.load`` or ``ctx.permanent.load``. | |
| To access data from ``shared`` or ``permanent``, you can use ``ctx.shared.load`` or ``ctx.permanent.load``. |
you were missing a word I think
|
No API break detected ✅ |
IAlibay
left a comment
There was a problem hiding this comment.
Some initial thoughts / questions ahead of tomorrow's meeting.
| "result_path": result_path_final_location, | ||
| } | ||
|
|
||
| The example above showcases how |
|
|
||
| .. code-block:: python | ||
|
|
||
| ctx.shared.register("myfile.dat") |
There was a problem hiding this comment.
What if your underlying code cannot handle Path like objects? For example, the multistate sampler stores the checkpoint file using a filename that is relative to the main storage path, so when you pass the file it's just checkpoint.chk.
There was a problem hiding this comment.
So you can use registration as well, however we assume that everything is stored in scratch. Remember that we explicitly make it such that the registered files are not Path-like objects to ensure that people don't use them as paths. One thing we could do, is remove the requirement that everything is stored in scratch and then you can register any file to be transferred at the end of the run.
There was a problem hiding this comment.
Potentially add just dumping loaded objects as Pathlib objects.
| ``ExternalStorage`` Base Class | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| The :class:`.ExternalStorage` abstract base class defines the interface that all storage implementations must provide. This class provides: |
There was a problem hiding this comment.
I can see a get_filename method, but what if I want the full path / operate on the Pathlib object (i.e. if I want to get the file extension or the parent directory)?
There was a problem hiding this comment.
ExternalStorage objects intentionally don't use Pathlib so that we can abstract over the storage medium. This allows execution engines the choice of how they want to store files (which might not always be a filesystem).
| "result_path": result_path_final_location, | ||
| } | ||
|
|
||
| The example above showcases how |
This PR closes #695, providing documentation on
ExternalStorageandContext.Checklist
newsentryDevelopers certificate of origin