Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using a sos namespace #1540

Open
BoPeng opened this issue Feb 16, 2024 · 0 comments
Open

Using a sos namespace #1540

BoPeng opened this issue Feb 16, 2024 · 0 comments
Milestone

Comments

@BoPeng
Copy link
Contributor

BoPeng commented Feb 16, 2024

One of the problems with sos if that sos is built on top of python so there is a high probability of name clash. For example, users could accidentally define run and clash with our run action.

We have tried to resolve this issue with _input, SOS_CONFIG etc, but things like python still has a high risk of name conflict. I propose that we put everything into a sos namespace so that

  • sos.inputs is _input, the input for the current substep, which is the sos_target object.
  • sos.input is _input[0], which is the default for input with a single input. No automatic _input to _input[0] will be performed (which complicated the code quite a bit).
  • sos.group and sos.groups for results of group_by. In this way, group_by does not change _input by default.
  • sos.outputs and sos.output follows the same convension.
  • sos.step_input and sos.step_output are step_input and step_output.
  • sos.config is the SOS_CONFIG
  • sos.run_script("R", ...) is what R: will be translated to. The same goes to sos.python etc.. We may stick to sos.Retc, butsos.run` conflicts with the workflow execution function below.
  • sos.run will be sos_run for executing subworkflows.
  • sos.__dict__ will be sos_dict which is the namespace we use to store all runtime dictionaries.

In this way, sos adds on top of Python

  1. Directives such as input:, output:, depends:, task:.
  2. A syntax sugar for scripting running actions such as R: and Python:.
  3. A sos namespace with data and functions.

Backward compatibility can be temporarily retained by making existing objects available (e.g. R:) but gives a deprecation warning.

Note that

  1. the level of change may trigger the development of sos.2 in a separate repository, where we will reexamine the generic design and implementation issues with sos, such as remote/multi-node execution, and subworkflows.
  2. we need to rigorously define these variables, how they are transferred (across steps, processes, and nodes), and how they change during the execution of the workflows. This is especially important for concurrent execution of substeps using async.
@BoPeng BoPeng added this to the 1.0 milestone Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant