You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use CalculusWithJuliaSquared instead of a direct Plots dependency (#2)
* Use CalculusWithJuliaSquared instead of a direct Plots dependency
Adds CalculusWithJuliaSquared (personal pure-Julia fork of
CalculusWithJulia.jl, unregistered -- installed from its GitHub URL,
Manifest pins repo-url tracking master) and reexports it from the Calculus
module. It brings Plots, Symbolics, Roots, LinearAlgebra, SpecialFunctions,
and IntervalSets through its own reexport chain, plus calculus utilities
(riemann, fubini, lim, sign_chart, tangent, secant, D/f' notation) and
plotting recipes (plotif, trimplot, riemann_plot, newton_plot!, ...), so:
- Plots removed from Project.toml (arrives transitively)
- The module's GKSwstype headless-CI block removed -- CalculusWithJuliaSquared
runs the same pattern at its own load time
- copilot-instructions.md gains a "What CalculusWithJuliaSquared Provides"
section so future sessions know what already exists before writing new
functions; source.instructions.md dependency/module sections updated to
match reality (also drops BlockArrays/LAlatex mentions that were template
leftovers never actually in Project.toml)
Test suite passes; verified `using Calculus` alone provides plot,
@variables, riemann, and the L"..." macro.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Add [sources] entry so CI can resolve the unregistered dependency
CI failed with "expected package CalculusWithJuliaSquared to be
registered": Pkg.add(url=...) records the GitHub source only in the
Manifest, which is gitignored in this repo, so CI resolving from
Project.toml alone looked for the package in the General registry.
The [sources] section (Julia 1.11+) declares the URL in the committed
Project.toml, making instantiation work from a clean clone.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Instructions: document the [sources] requirement for the unregistered dep
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Truth up notebooks.instructions.md: LAlatex/BlockArrays are not reexported
The claim that LAlatex, BlockArrays, and LaTeXStrings are re-exported by
the module was never true (inherited from the canonical template, where it
is false for Linear_Algebra as well -- only LaTeXStrings is reexported).
LAlatex and BlockArrays live in notebooks/Project.toml only and need their
own `using` in the setup cell. Also fixes a leftover "using Linear_Algebra"
mention and the plot_param_line example from the template, pointing at the
CalculusWithJuliaSquared recipes instead.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,22 @@
8
8
9
9
### Core Architecture
10
10
11
-
-**`src/Calculus.jl`**: Main module; uses `@reexport` to re-export `Plots`, `BlockArrays`, `LAlatex`,`LaTeXStrings` — consumers get all exported names with a single `using Calculus`
11
+
-**`src/Calculus.jl`**: Main module; uses `@reexport` to re-export `CalculusWithJuliaSquared` and`LaTeXStrings` — consumers get all exported names with a single `using Calculus`
12
12
-**`test/`**: Tests using `Calculus` and `Test` only — re-exported names are available via `@reexport`, no explicit `using` needed in test files
13
13
-**`docs/`**: Documenter.jl deploying to `https://study.fourm.info/calculus/` (cross-repo to `math_tech_study`)
14
14
-**`notebooks/`**: Jupyter notebooks for exploration (not tested in CI)
15
15
16
+
### What CalculusWithJuliaSquared Provides
17
+
18
+
[`CalculusWithJuliaSquared`](https://github.com/FourMInfo/CalculusWithJuliaSquared.jl) is a personal, pure-Julia (zero-Python) fork of `CalculusWithJulia.jl`. It's **unregistered**, so its GitHub URL is declared in `Project.toml`'s `[sources]` section — required because Manifests are gitignored here, and without `[sources]` a clean clone (e.g. CI) tries the General registry and fails. Keep that section intact. It reexports `Plots`, `Symbolics`, `Roots`, `LinearAlgebra`, `SpecialFunctions`, and `IntervalSets`, and auto-configures the GR backend for headless CI at load time — so this repo needs **no direct `Plots` dependency and no GKS setup of its own**. Available after `using Calculus`:
-**Calculus utilities**: `riemann` (8 methods), `fubini`, `lim` (limit tables), `sign_chart`, `tangent`, `secant`, `D` and the `f'` prime notation (via ForwardDiff), `unzip`, `rangeclamp`, `const e`
22
+
-**Symbolic math** (pure Julia): `@variables` etc. via Symbolics, plus symbolic `gradient`/`divergence`/`curl` for `Symbolics.Num`; `∇`, `∇⋅`, `∇×` operators work numerically and symbolically
23
+
-**Root finding**: `fzero`/`fzeros` via Roots
24
+
25
+
To update to a newer CWJS commit: `julia --project=. -e 'using Pkg; Pkg.update("CalculusWithJuliaSquared")'`. Never re-add `Plots`/`SymPy` directly here — plotting comes through CWJS, and CWJS's whole purpose is keeping Python out.
26
+
16
27
## Julia Workspace Layout
17
28
18
29
This repository uses a Julia workspace. The root `Project.toml` has a `[workspace]` table listing
Copy file name to clipboardExpand all lines: .github/instructions/notebooks.instructions.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,12 +10,17 @@ All notebooks should start with the standard setup cell:
10
10
```julia
11
11
using Revise
12
12
using Calculus
13
+
using LAlatex, BlockArrays
13
14
14
15
LAlatex.set_backend!(:symbolics)
15
16
LAlatex.reset_display_defaults!()
16
17
```
17
18
18
-
`LAlatex`, `BlockArrays`, and `LaTeXStrings` are re-exported by `Calculus`, so no separate `using` is needed. In particular, the `L"..."` string macro is available immediately after `using Linear_Algebra`.
19
+
What comes from where:
20
+
21
+
-`using Calculus` provides everything the module reexports — `LaTeXStrings` (the `L"..."` macro) plus the full `CalculusWithJuliaSquared` chain (`Plots`, `Symbolics`, `Roots`, calculus utilities and plotting recipes — see "What CalculusWithJuliaSquared Provides" in `copilot-instructions.md`).
22
+
-`LAlatex` and `BlockArrays` are **notebooks-environment dependencies only** (in `notebooks/Project.toml`, not the root project), so they need their own `using` line — they are *not* re-exported by `Calculus`.
23
+
19
24
`set_backend!(:symbolics)` is required because this package uses Symbolics.jl; the default `:latexify` backend gives worse output for symbolic expressions.
20
25
`reset_display_defaults!()` ensures a clean display state on every kernel restart.
-Use the same plotting functions from the package (`plot_param_line`, etc.)
40
+
-Prefer the ready-made recipes from `CalculusWithJuliaSquared` (`plotif`, `riemann_plot`, `plot_parametric`, `vectorfieldplot`, …) and this package's own plotting functions before writing new ones
36
41
37
42
## LAlatex Display
38
43
39
-
[LAlatex.jl](https://github.com/ea42gh/LAlatex.jl) (by ea42gh) is re-exported by `Linear_Algebra`and provides clean LaTeX rendering of linear algebra objects in notebooks. Use it instead of raw `println` or `display` whenever presenting mathematical results.
44
+
[LAlatex.jl](https://github.com/ea42gh/LAlatex.jl) (by ea42gh) is available in the notebooks environment (`using LAlatex` in the setup cell) and provides clean LaTeX rendering of mathematical objects in notebooks. Use it instead of raw `println` or `display` whenever presenting mathematical results.
`CalculusWithJuliaSquared` brings `Plots`, `Symbolics`, `Roots`, `LinearAlgebra`, `SpecialFunctions`, and `IntervalSets` with it, plus ready-made calculus utilities and plotting recipes (see the "What CalculusWithJuliaSquared Provides" section in `copilot-instructions.md`). **Check there before writing a new function — it may already exist** (e.g. `riemann_plot`, `plotif`, `tangent`, `lim`).
23
+
22
24
## CI/Interactive Detection
23
25
24
-
Module auto-configures at load time using `GKSwstype`. See the `julia-coding-conventions` skill for the canonical pattern. The check goes in the main module file (`Calculus.jl`) after the `@reexport` block.
26
+
Handled by `CalculusWithJuliaSquared`at its own load time (the canonical `GKSwstype` pattern from the `julia-coding-conventions` skill lives there now). This module needs no GKS configuration of its own.
**Main Dependencies**: CalculusWithJuliaSquared (unregistered, installed by GitHub URL), LaTeXStrings, Reexport
69
71
70
72
### Libraries Used
71
-
-**Plots.jl**: For visualization functions
72
-
-**BlockArrays.jl**: For block-structured arrays
73
-
-**LAlatex.jl**: For LaTeX rendering in notebooks
73
+
-**CalculusWithJuliaSquared.jl**: calculus utilities, plotting recipes, and the full reexport chain (Plots, Symbolics, Roots, LinearAlgebra, SpecialFunctions, IntervalSets) — pure Julia, zero Python by design; never add `Plots` or `SymPy` directly here
74
74
-**LaTeXStrings.jl**: For `L"..."` string macro
75
75
-**Reexport.jl**: For `@reexport` clean module interface
0 commit comments