Skip to content

Cecil data analysis with xarray-sql — skill + tutorial#5

Merged
alexlogs merged 1 commit into
mainfrom
proposal/data-analysis-xql-as-tutorial
May 18, 2026
Merged

Cecil data analysis with xarray-sql — skill + tutorial#5
alexlogs merged 1 commit into
mainfrom
proposal/data-analysis-xql-as-tutorial

Conversation

@alexlogs
Copy link
Copy Markdown
Contributor

Splitting into two artifacts:

  • skills/cecil-data-analysis-xql/SKILL.md (~135 lines) - Links out to the tutorial for everything else.

  • tutorials/cecil-data-analysis-xql/
    ├── README.md full Step 0–5 walkthrough + worked example
    ├── references/ datasets.md, sdk.md, xarray_sql.md (Jayendra's)
    └── scripts/ _env.py, list_subscriptions.py, inspect_dataset.py,
    run_analysis.py (Jayendra's, with three small fixes)

Three review fixes applied to the script:

  1. run_analysis.py: added --vector flag using load_dataframe + XarrayContext.from_pandas. Previously the runner unconditionally called load_xarray, which would fail on IBAT vector datasets the description says are in scope ("threatened species ranges intersect this AOI").
  2. run_analysis.py: replaced fig.autofmt_xdate() in the bar-chart branch with rotation of categorical xticks. autofmt_xdate is a date-axis helper applied to a non-date axis.
  3. README.md: pinned xarray-sql to a sub-0.1 range (pre-1.0 package; the XarrayContext().from_dataset() API is the kind that drifts in 0.x).

Also dropped the bash-specific set -a && source .env && set +a syntax from the prerequisites — fish/zsh-without-posix users would hit it.

Structural restructure of #4 (jayendra13/add-cecil-data-analysis-xql-skill).
The original PR is a single skill containing 4 runnable Python scripts and
3 reference documents (~1,200 LOC). That shape is closer to a tutorial than
a skill — skills are short, focused text loaded into an agent's context at
inference time, not multi-file CLI projects.

Splitting into two artifacts:

- skills/cecil-data-analysis-xql/SKILL.md (~135 lines)
  Just what an agent needs in-context: the subscription gate (wallet
  safety), the golden-rule output format, the SQL idioms, the PascalCase
  quoting rule, vector-vs-raster routing, and failure modes. Links out to
  the tutorial for everything else.

- tutorials/cecil-data-analysis-xql/
  ├── README.md          full Step 0–5 walkthrough + worked example
  ├── references/        datasets.md, sdk.md, xarray_sql.md (Jayendra's)
  └── scripts/           _env.py, list_subscriptions.py, inspect_dataset.py,
                         run_analysis.py (Jayendra's, with three small fixes)

Three review fixes applied to the script:

1. run_analysis.py: added --vector flag using load_dataframe +
   XarrayContext.from_pandas. Previously the runner unconditionally called
   load_xarray, which would fail on IBAT vector datasets the description
   says are in scope ("threatened species ranges intersect this AOI").

2. run_analysis.py: replaced fig.autofmt_xdate() in the bar-chart branch
   with rotation of categorical xticks. autofmt_xdate is a date-axis
   helper applied to a non-date axis.

3. README.md: pinned xarray-sql to a sub-0.1 range (pre-1.0 package; the
   XarrayContext().from_dataset() API is the kind that drifts in 0.x).

Also dropped the bash-specific `set -a && source .env && set +a` syntax
from the prerequisites — fish/zsh-without-posix users would hit it.

If this merges, #4 should close as superseded.

Co-Authored-By: jayendra13 <jayendra0parmar@gmail.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@alexlogs alexlogs merged commit 66664b5 into main May 18, 2026
3 checks passed
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