{{ message }}
Makes the arguments from RAT_main and events data pickleable - #74
Merged
StephenNneji merged 1 commit intoSep 4, 2024
Merged
Conversation
alexhroom
reviewed
Sep 4, 2024
Collaborator
There was a problem hiding this comment.
looks good: can now run the following:
from concurrent.futures import ProcessPoolExecutor
import RATapi as RAT
def run(problem_definition, cells, limits, priors, cpp_controls):
problem_definition, output_results, bayes_results = RAT.rat_core.RATMain(
problem_definition,
cells,
limits,
cpp_controls,
priors,
)
results = RAT.outputs.make_results("calculate", output_results, bayes_results)
return results
pool = ProcessPoolExecutor()
project, _ = RAT.examples.DSPC_standard_layers()
c = RAT.Controls()
problem_definition, cells, limits, priors, cpp_controls = RAT.inputs.make_input(project, c)
result = pool.submit(run, problem_definition, cells, limits, priors, cpp_controls)
results = result.result()
print(results)can't quite pickle the entire Project object yet: with dill, the error I get is that RATapi.rat_core.EventBridge is not pickleable. Would it be difficult to make that pickleable too? no worries if it's a lot of trouble to pickle (or you foresee other problems), the above is definitely workable for what we need!
Contributor
Author
alexhroom
approved these changes
Sep 4, 2024
alexhroom
left a comment
Collaborator
There was a problem hiding this comment.
no worries then! i don't understand either, but this should do
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Addresses part of #73