Skip to content

Export zip file with batch files and metadata - #8

Merged
ka-sarthak merged 15 commits into
mainfrom
zip-export
Jan 15, 2026
Merged

Export zip file with batch files and metadata#8
ka-sarthak merged 15 commits into
mainfrom
zip-export

Conversation

@ka-sarthak

@ka-sarthak ka-sarthak commented Jan 15, 2026

Copy link
Copy Markdown
Collaborator

Main pain point resolved: Merging all the batch files into one big file can run into a high memory footprint (potentially crashing the pods). Here's the consolidation has been made optional, and the dataset files are exported as a zip. Additionally, the zip now contains a JSON file containing metadata of the export workflow.

Output settings and batch control

  • Introduced a new OutputSettings model to allow users to specify output file type, batch size, and whether to merge output files. Integrated these settings into the workflow and models. [1] [2] [3]

Enhanced metadata and export process

  • Added detailed metadata tracking for exports, including number of entries and search timestamps, and included this metadata in a metadata.json file inside the exported zip archive. [1] [2] [3]
  • Refactored the export activity to package all generated files (potentially multiple batches) and the metadata into a single zip file for upload, with improved filename uniqueness handling.

Output file merging and terminology updates

  • Renamed all references from consolidate_output_files to merge_output_files throughout the codebase, including activity, model, and utility function names, and updated related descriptions for clarity. [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Updated the workflow to use the new merge_output_files activity and model, and to conditionally merge output files based on user settings. [1] [2]

Search activity improvements

  • Modified the search activity to record the start and end time of each search batch and the number of entries, passing this information through to the export process. [1] [2] [3]

These changes collectively make the export workflow more robust, configurable, and informative for users.

Copilot AI left a comment

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.

Pull request overview

This pull request introduces significant enhancements to the export workflow by adding configurable output settings, batch control, and comprehensive metadata tracking. The changes enable users to control file types, batch sizes, and whether to merge output files, while packaging all exports with detailed metadata into a single zip file.

Changes:

  • Introduced OutputSettings model to centralize output file configuration (file type, batch size, merge option)
  • Refactored export process to create zip archives containing batch files and metadata.json
  • Renamed all consolidate_output_files references to merge_output_files for clarity
  • Enhanced metadata tracking with entry counts and search timestamps

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
src/nomad_actions/actions/entries/models.py Added OutputSettings and ExportDatasetMetadata models; refactored ExportEntriesUserInput to use OutputSettings; renamed ConsolidateOutputFilesInput to MergeOutputFilesInput
src/nomad_actions/actions/entries/activities.py Renamed consolidate_output_files to merge_output_files; refactored export_dataset_to_upload to create zip files with metadata; added timestamp tracking to search activity
src/nomad_actions/actions/entries/workflows.py Updated workflow to use new OutputSettings model; added metadata collection during search loops; made merging conditional based on user settings
src/nomad_actions/actions/entries/utils.py Renamed consolidate_files to merge_files with updated documentation
src/nomad_actions/actions/entries/init.py Updated imports to use merge_output_files instead of consolidate_output_files
tests/actions/test_action.py Updated imports to use merge_output_files instead of consolidate_output_files
Comments suppressed due to low confidence (1)

tests/actions/test_action.py:15

  • The test file is missing the import for OutputSettings which is now required to construct ExportEntriesUserInput properly. Add OutputSettings to the imports from nomad_actions.actions.entries.models.
from nomad_actions.actions.entries.models import (
    ExportEntriesUserInput,
    SearchSettings,
)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/nomad_actions/actions/entries/activities.py Outdated
Comment thread src/nomad_actions/actions/entries/workflows.py
Comment thread src/nomad_actions/actions/entries/activities.py Outdated
Comment thread src/nomad_actions/actions/entries/activities.py Outdated
Comment thread src/nomad_actions/actions/entries/activities.py Outdated
Comment thread src/nomad_actions/actions/entries/models.py
Comment thread src/nomad_actions/actions/entries/activities.py Outdated
Comment thread src/nomad_actions/actions/entries/workflows.py
Comment thread src/nomad_actions/actions/entries/activities.py Outdated
Comment thread src/nomad_actions/actions/entries/models.py Outdated
@coveralls

coveralls commented Jan 15, 2026

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 21039089009

Details

  • 20 of 71 (28.17%) changed or added relevant lines in 3 files are covered.
  • 6 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.001%) to 34.419%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/nomad_actions/actions/entries/models.py 19 20 95.0%
src/nomad_actions/actions/entries/workflows.py 0 12 0.0%
src/nomad_actions/actions/entries/activities.py 1 39 2.56%
Files with Coverage Reduction New Missed Lines %
src/nomad_actions/actions/entries/workflows.py 1 27.03%
src/nomad_actions/actions/entries/activities.py 5 16.67%
Totals Coverage Status
Change from base Build 21001802622: -0.001%
Covered Lines: 78827
Relevant Lines: 229020

💛 - Coveralls

@ka-sarthak
ka-sarthak merged commit 7a8d4da into main Jan 15, 2026
2 checks passed
@ka-sarthak
ka-sarthak deleted the zip-export branch January 15, 2026 16:48
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.

3 participants