Skip to content

Add Cohort.load() and Study.load() for reattaching executed results - #294

Merged
ha-my-bui merged 5 commits into
mainfrom
feature/study-load
Oct 15, 2026
Merged

ha-my-bui merged 5 commits into
mainfrom
feature/study-load

Conversation

@ha-my-bui

Copy link
Copy Markdown
Collaborator

load() points a cohort or study back at the tables a previous execute() already wrote, without recomputing anything. In a fresh session, re-run the cells that define the study, skip execute().

  • phenex/core/cohort.py: rebuilds the plan in memory, asks the destination once, records where each step's table lives, fetches only the index table.
  • phenex/core/study.py: load parents before subcohorts, one destination listing per connector, passed down to each cohort.
  • phenex/core/subcohort.py: loads the parent first if needed then subcohorts.
  • phenex/ibis_connect.py: list_dest_tables() added to the Snowflake, DuckDB and Postgres connectors.
  • Tests
  • Docs

@ha-my-bui
ha-my-bui requested a review from a-hartens as a code owner September 2, 2026 20:31

@a-hartens a-hartens left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this looks great. the only thing missing is the characteristics_table! could you add that the same way that subset_tables_entry/index are recomputed if not written? otherwise looks great!

@ha-my-bui

Copy link
Copy Markdown
Collaborator Author

this looks great. the only thing missing is the characteristics_table! could you add that the same way that subset_tables_entry/index are recomputed if not written? otherwise looks great!

Hi! Load for the characteristics table now added.

@ha-my-bui ha-my-bui closed this Sep 15, 2026
@ha-my-bui ha-my-bui reopened this Sep 15, 2026
@ha-my-bui ha-my-bui self-assigned this Sep 18, 2026
@ha-my-bui
ha-my-bui requested a review from a-hartens September 29, 2026 10:05

@a-hartens a-hartens left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

beautiful!

Comment thread phenex/core/study.py
return path_exec_dir_study

@contextmanager
def _with_study_reporters(self, cohort):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

very cool solution!

@ha-my-bui
ha-my-bui merged commit c73eaed into main Oct 15, 2026
4 checks passed
@ha-my-bui
ha-my-bui deleted the feature/study-load branch October 15, 2026 16:42
@ha-my-bui ha-my-bui added the Major additions Adding new phenotype, filters, aggregators, etc label Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Major additions Adding new phenotype, filters, aggregators, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants