Skip to content

addpath(genpath) for future ops in subdirs#413

Open
jbrzensk wants to merge 2 commits into
mainfrom
chore/add_matlab_path_recurse
Open

addpath(genpath) for future ops in subdirs#413
jbrzensk wants to merge 2 commits into
mainfrom
chore/add_matlab_path_recurse

Conversation

@jbrzensk

@jbrzensk jbrzensk commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Example
  • Documentation

Description

Adds a recursive path to the MATLAB examples. This future-izes the MATLAB_Octave examples, by taking subfolders from the src library.

Related Issues & Documents

Copilot AI review requested due to automatic review settings July 2, 2026 23:07
@jbrzensk jbrzensk self-assigned this Jul 2, 2026
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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 PR updates MATLAB/Octave tests and example scripts to add the src/matlab_octave directory recursively to the MATLAB path (via addpath(genpath(...))), so future library subfolders are picked up automatically.

Changes:

  • Switched many scripts/tests from addpath('../../src/matlab_octave') to addpath(genpath('../../src/matlab_octave')).
  • Applied the same recursive-path approach consistently across MATLAB/Octave unit tests and examples.

Reviewed changes

Copilot reviewed 76 out of 76 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
tests/matlab_octave/testLapPolynomial.m Use recursive path add to include src/matlab_octave subfolders during tests.
tests/matlab_octave/testLaplacian.m Use recursive path add to include src/matlab_octave subfolders during tests.
tests/matlab_octave/testGradPolynomial.m Use recursive path add to include src/matlab_octave subfolders during tests.
tests/matlab_octave/testGradient.m Use recursive path add to include src/matlab_octave subfolders during tests.
tests/matlab_octave/testEnergy.m Use recursive path add to include src/matlab_octave subfolders during tests.
tests/matlab_octave/testDivPolynomial.m Use recursive path add to include src/matlab_octave subfolders during tests.
tests/matlab_octave/testDivergence.m Use recursive path add to include src/matlab_octave subfolders during tests.
tests/matlab_octave/testBCConsistency.m Use recursive path add to include src/matlab_octave subfolders during tests.
tests/matlab_octave/testAddScalarBC.m Use recursive path add to include src/matlab_octave subfolders during tests.
examples/matlab_octave/wave2D.m Use recursive path add so examples can find functions in nested src/matlab_octave folders.
examples/matlab_octave/wave2D_case2.m Use recursive path add so examples can find functions in nested src/matlab_octave folders.
examples/matlab_octave/wave1DTimeVaryingBC.m Use recursive path add so examples can find functions in nested src/matlab_octave folders.
examples/matlab_octave/wave1D.m Use recursive path add so examples can find functions in nested src/matlab_octave folders.
examples/matlab_octave/wave1D_convergence/wave1D_convergence.m Use recursive path add so convergence example can find nested src/matlab_octave functions.
examples/matlab_octave/wave1D_case2.m Use recursive path add so examples can find functions in nested src/matlab_octave folders.
examples/matlab_octave/van_der_pol.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/tutorials/two_way_wave_equation/comparison_two_way_wave_md_vs_fd.m Use recursive path add so tutorial can find functions in nested src/matlab_octave folders.
examples/matlab_octave/test_nodal2DCurv.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/test_lap3DCurv.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/test_lap3DCurv_case2.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/test_grad3DCurv.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/test_grad2DCurv.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/test_div3DCurv.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/test_div2DCurv.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/test_curl.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/terzaghi1D.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/sturmLiouvilleLegendre.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/sturmLiouvilleLaguerre.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/sturmLiouvilleHermite.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/sturmLiouvilleHelmholtzDirichletRobin.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/sturmLiouvilleHelmholtzDirichletDirichlet.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/sturmLiouvilleChebyshev.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/sturmLiouvilleBessel.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/schrodinger2D.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/richards.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/poisson2D.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/parabolic2D.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/parabolic1D.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/maxwell1D.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/lock_exchange.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/KG_product.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/integration1D.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/hyperbolic1D.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/hyperbolic1D_upwind.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/hyperbolic1D_lax_friedrichs.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/helmholtz2D_wifi.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic3DXNeumannYPeriodicZPeriodic.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic3DXDirichletYPerZPer.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic3DXDirichletYPerZNeumann.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic3DXDirichletYPeriodicZPeriodic.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic3DXDirichletYDirichletZDirichlet.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic3DaddScalarBC3D.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic3D.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic2DXPerYDirichlet.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic2DXPeriodicYPeriodic.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic2DXDirichletYDirichlet.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic2DPeriodic.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic2D.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic2D_nodal_curv.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic2D_nodal_curv_sinusoidal.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic2D_case2.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic1DPeriodicBC.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic1DNonPeriodicBC.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic1DNonHomogeneousDirichlet.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic1DLeftRobinRightRobin.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic1DLeftNeumannRightRobin.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic1DLeftNeumannRightNeumann.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic1DLeftNeumannRightDirichlet.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic1DLeftDirichletRightRobin.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic1DHomogeneousDirichlet.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic1DaddScalarBC.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/elliptic1D.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/cylinder_flow_2D.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/convection_diffusion3D.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/Compact_operators/compact.m Use recursive path add so example can find functions in nested src/matlab_octave folders.
examples/matlab_octave/burgers1D.m Use recursive path add so example can find functions in nested src/matlab_octave folders.

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

Comment thread tests/matlab_octave/testLapPolynomial.m
Comment thread tests/matlab_octave/testGradPolynomial.m
methods (Test)
function testDivOfPolynomial1D(testCase)
addpath('../../src/matlab_octave')
addpath(genpath('../../src/matlab_octave'))

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Is this Octave safe?

Comment thread tests/matlab_octave/testLaplacian.m
Comment thread tests/matlab_octave/testGradient.m
Comment thread tests/matlab_octave/testEnergy.m
Comment thread tests/matlab_octave/testDivergence.m
Comment thread tests/matlab_octave/testBCConsistency.m
Comment thread tests/matlab_octave/testAddScalarBC.m
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.

Add path recursively in MATLAB scripts

3 participants