Skip to content

Handle missing implementation when resampling#76

Closed
cnativid wants to merge 4 commits intonasa:mainfrom
cnativid:handle-no-implementation
Closed

Handle missing implementation when resampling#76
cnativid wants to merge 4 commits intonasa:mainfrom
cnativid:handle-no-implementation

Conversation

@cnativid
Copy link
Copy Markdown
Contributor

@cnativid cnativid commented Apr 6, 2026

When running TrajectoryAnalysis in parallel/pickled function, implementation is missing. Resampling with include_output=True requires the implementation. Changes to resample() to only assign the implementation to the resampled sim only if it exists, and overrides include_output to False if the implementation is missing. Added a TODO: to optionally reconstruct the implementation.

Comment thread src/condor/contrib.py
new_self = model.__new__(model)
new_self.implementation = self.implementation
# TODO: add option to rebuild the implemention
if getattr(self, "implementation", False):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try hasattr(self, "implementation") for just checking whether or not the attribute exists

Comment thread src/condor/contrib.py
if getattr(self, "implementation", False):
new_self.implementation = self.implementation
else: # override include_output if implementation is not found
include_output = False
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we aren't (yet) automatically constructing the implementation, this should probably emit a warning (only if the user set include_output=True).

@ixjlyons
Copy link
Copy Markdown
Contributor

Merging this into #73 and will handle there

@ixjlyons
Copy link
Copy Markdown
Contributor

Closing since this was incorporated into #73. Thought it would auto close.

@ixjlyons ixjlyons closed this Apr 12, 2026
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

Successfully merging this pull request may close these issues.

2 participants