Skip to content

removed pdf docs and cleaned example#3

Merged
starry-phoenix merged 1 commit intomainfrom
remove-pdf
Mar 5, 2026
Merged

removed pdf docs and cleaned example#3
starry-phoenix merged 1 commit intomainfrom
remove-pdf

Conversation

@starry-phoenix
Copy link
Copy Markdown
Owner

@starry-phoenix starry-phoenix commented Mar 5, 2026

  • removed option to generate pdfs

Summary by Sourcery

Remove legacy salinity-specific example configuration and outputs while adding a quickstart notebook-based example and simplifying docs build options.

New Features:

  • Add a Jupyter quickstart example demonstrating model configuration, execution, analysis, and visualisation without Hydra.

Enhancements:

  • Simplify example configuration by inlining salinity and related parameters in the quickstart notebook instead of separate config fragments.
  • Remove obsolete example outputs and Hydra artefacts from version control to keep the repository clean.

Build:

  • Drop the Sphinx latexpdf docs build target, limiting docs builds to HTML and related commands.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Mar 5, 2026

Reviewer's Guide

Removes PDF/LaTeX documentation build support and obsolete salinity/Hydra example artifacts, and adds a self-contained Jupyter quickstart notebook demonstrating a simple SPyice model run without Hydra-based configuration files.

Sequence diagram for the new Hydra-free SPyice quickstart notebook workflow

sequenceDiagram
    actor User
    participant JupyterNotebook
    participant OmegaConf
    participant ConfigSort
    participant Utils_create_output_directory as create_output_directory
    participant PreProcess
    participant SeaIceModel
    participant Analysis
    participant VisualiseModel
    participant FileSystem

    User->>JupyterNotebook: Open quickstart_example.ipynb
    User->>JupyterNotebook: Run import cell
    JupyterNotebook->>OmegaConf: create(constants_dict)
    OmegaConf-->>JupyterNotebook: config_raw (OmegaConf)

    JupyterNotebook->>ConfigSort: getconfig_dataclass(config_raw, config_type_jupyter)
    ConfigSort-->>JupyterNotebook: config (dataclass)

    JupyterNotebook->>Utils_create_output_directory: create_output_directory(wo_hydra_dir, S_IC, dz, dt, iter_max, example)
    Utils_create_output_directory->>FileSystem: mkdir output paths
    FileSystem-->>Utils_create_output_directory: output_dir paths created
    Utils_create_output_directory-->>JupyterNotebook: out_dir_final

    User->>JupyterNotebook: Run preprocessing cell
    JupyterNotebook->>PreProcess: get_variables(config_raw, out_dir_final)
    PreProcess->>FileSystem: write preprocessing outputs
    PreProcess-->>JupyterNotebook: preprocess_data, userinput_data

    User->>JupyterNotebook: Set model options on userinput_data

    User->>JupyterNotebook: Run model cell
    JupyterNotebook->>SeaIceModel: get_results(preprocess_data, userinput_data)
    SeaIceModel->>FileSystem: write simulation outputs
    SeaIceModel-->>JupyterNotebook: results_data

    JupyterNotebook->>Analysis: get_error_results(t_k_diff, t_stefan_diff, residual, temperature_mushy, phi_mushy, salinity_mushy, output_dir)
    Analysis->>FileSystem: export residuals and error summaries
    Analysis-->>JupyterNotebook: analysis_data

    User->>JupyterNotebook: Create visualization object
    JupyterNotebook->>VisualiseModel: __init__(userinput_data, results_data, analysis_data)
    VisualiseModel-->>JupyterNotebook: model_visualization_object

    User->>JupyterNotebook: Call plot_error_temp, plot_depth_over_time, plot_temperature_heatmap, plot_salinity_heatmap
    JupyterNotebook->>VisualiseModel: plotting methods
    VisualiseModel->>FileSystem: optionally save figures, CSV
    VisualiseModel-->>JupyterNotebook: rendered plots in notebook
Loading

Flow diagram for updated documentation build scripts (HTML only, no PDF)

flowchart LR
    subgraph DocsScripts["Docs build scripts in pyproject.toml"]
      Clean["clean: make clean --directory=docs"]
      Html["html: make html --directory=docs"]
      Serve["serve: python -m http.server --directory=docs/build/html/"]
      Build["build: make clean --directory=docs && make html --directory=docs"]
    end

    User["Developer running docs commands"] --> Clean
    User --> Html
    User --> Serve
    User --> Build

    %% Previously there was a latexpdf target to build PDFs; it is now removed
    %% so the flow now only supports HTML documentation generation.
Loading

File-Level Changes

Change Details Files
Removed PDF/LaTeX Sphinx docs build support from the project configuration.
  • Removed the docs latexpdf build target from the Hatch docs environment scripts so only HTML-related tasks remain
pyproject.toml
Simplified example configuration by dropping the salinity initial-condition preset from Hydra config and removing corresponding example salinity configs and outputs.
  • Removed S_IC from the example Hydra defaults list so salinity IC is no longer a selectable default in that example config
  • Removed S_IC from the Hydra help/choice list for example runs
  • Deleted example salinity configuration files and associated sample output artifacts and Hydra run metadata
example/conf/config.yaml
example/conf/S_IC/S34.yaml
example/conf/salinity/no.yaml
example/conf/salinity/yes.yaml
example/output/with_hydra/Temperature_S34_Dirichlet_0.01_47.0_500_const_dens-mushfix/Temperature0.01.csv
example/outputs/2024-08-26/234047_real_47.0_1000/.hydra/config.yaml
example/outputs/2024-08-26/234047_real_47.0_1000/.hydra/hydra.yaml
example/outputs/2024-08-26/234047_real_47.0_1000/.hydra/overrides.yaml
example/outputs/2024-08-26/234047_real_47.0_1000/main_config.log
Added a new self-contained Jupyter quickstart notebook illustrating building, running, and visualizing a simple SPyice sea-ice model without Hydra.
  • Introduced a notebook that constructs an OmegaConf config in-code for constants, dt, S_IC, iter_max, and dz and converts it to the internal dataclass via ConfigSort.getconfig_dataclass with config_type='jupyter'
  • Demonstrated creation of an output directory using create_output_directory and running preprocessing with PreProcess.get_variables
  • Showed how to set model options (e.g., is_diffusiononly_equation), run SeaIceModel.get_results, perform error analysis via Analysis.get_error_results, and create a VisualiseModel for plotting error, depth-over-time, and temperature/salinity heatmaps
example/quickstart_example.ipynb

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@starry-phoenix starry-phoenix merged commit 67d4f64 into main Mar 5, 2026
1 check passed
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The quickstart_example.ipynb is checked in with execution counts, outputs, and large embedded images; consider clearing outputs and resetting execution counts before committing to keep diffs small and avoid bloating the repo.
  • The notebook hardcodes documentation links to http://[::1]:8000; it would be more robust to point to a stable public URL or a relative docs path so that users running the notebook elsewhere don't get broken links.
  • In quickstart_example.ipynb you import both create_output_directory and ConfigSort from spyice.utils in separate statements; you can simplify by importing them together from the same module in one line to keep the imports tidy.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The quickstart_example.ipynb is checked in with execution counts, outputs, and large embedded images; consider clearing outputs and resetting execution counts before committing to keep diffs small and avoid bloating the repo.
- The notebook hardcodes documentation links to http://[::1]:8000; it would be more robust to point to a stable public URL or a relative docs path so that users running the notebook elsewhere don't get broken links.
- In quickstart_example.ipynb you import both `create_output_directory` and `ConfigSort` from `spyice.utils` in separate statements; you can simplify by importing them together from the same module in one line to keep the imports tidy.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@starry-phoenix starry-phoenix deleted the remove-pdf branch March 5, 2026 20:23
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.

1 participant