Skip to content

Commit 28abed3

Browse files
authored
Add rename_dictionnary parameter to plotting functions for custom display names with alphabetical sorting (#157)
1 parent 8022d9f commit 28abed3

22 files changed

+2041
-362
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: CI
22
on:
33
- push
44
# - pull_request
5+
6+
# needed to allow julia-actions/cache to delete old caches that it has created
7+
permissions:
8+
actions: write
9+
contents: read
10+
511
jobs:
612
test:
713
env:
@@ -117,7 +123,7 @@ jobs:
117123
arch: x64
118124
test_set: "jet"
119125
allow_failure: true
120-
- version: '1'
126+
- version: '1.11'
121127
os: ubuntu-latest
122128
arch: x64
123129
test_set: "jet"
@@ -126,19 +132,30 @@ jobs:
126132
arch: x64
127133
test_set: "jet"
128134
steps:
129-
- uses: actions/checkout@v4
135+
- uses: actions/checkout@v5
130136
- uses: julia-actions/setup-julia@v2
131137
with:
132138
version: ${{ matrix.version }}
133139
arch: ${{ matrix.arch }}
134-
# On the Julia “pre” matrix entries, drop the unsupported test-only package
135-
- name: Remove Pigeons from targets on pre Julia
136-
if: matrix.version == 'pre'
140+
- name: Remove Pigeons from non estimation runs
141+
if: contains(matrix.test_set, 'estimat') == false
142+
shell: bash
143+
run: |
144+
sed -i.bak \
145+
-e '/^\[targets\]/,$ s/,[[:space:]]*"Pigeons"//g' \
146+
-e '/^\[targets\]/,$ s/"Pigeons",[[:space:]]*//g' \
147+
Project.toml
148+
rm -f Project.toml.bak
149+
150+
- name: Remove JET from estimation runs
151+
if: contains(matrix.test_set, 'estimat') == true
152+
shell: bash
137153
run: |
138-
sed -i \
139-
-e '/^\[targets\]/,$s/,[[:space:]]*"Pigeons"//g' \
140-
-e '/^\[targets\]/,$s/"Pigeons",[[:space:]]*//g' \
154+
sed -i.bak \
155+
-e '/^\[targets\]/,$ s/,[[:space:]]*"JET"//g' \
156+
-e '/^\[targets\]/,$ s/"JET",[[:space:]]*//g' \
141157
Project.toml
158+
rm -f Project.toml.bak
142159
- name: Set Custom Test Environment Variable (Windows)
143160
if: matrix.os == 'windows-latest'
144161
run: echo "TEST_SET=${{ matrix.test_set }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
@@ -148,16 +165,7 @@ jobs:
148165
- name: Set JULIA_NUM_THREADS for estimation tests
149166
if: (matrix.version == '1' && (matrix.test_set == 'estimation' || matrix.test_set == 'estimate_sw07' || matrix.test_set == '1st_order_inversion_estimation'))
150167
run: echo "JULIA_NUM_THREADS=auto" >> $GITHUB_ENV
151-
- uses: actions/cache@v4
152-
env:
153-
cache-name: cache-artifacts
154-
with:
155-
path: ~/.julia/artifacts
156-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
157-
restore-keys: |
158-
${{ runner.os }}-test-${{ env.cache-name }}-
159-
${{ runner.os }}-test-
160-
${{ runner.os }}-
168+
- uses: julia-actions/cache@v2
161169
- uses: julia-actions/julia-buildpkg@v1
162170
- uses: julia-actions/julia-runtest@v1
163171
with:
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "Copilot Setup Steps"
2+
3+
# Automatically run the setup steps when they are changed to allow for easy validation, and
4+
# allow manual testing through the repository's "Actions" tab
5+
on:
6+
workflow_dispatch:
7+
push:
8+
paths:
9+
- .github/workflows/copilot-setup-steps.yml
10+
pull_request:
11+
paths:
12+
- .github/workflows/copilot-setup-steps.yml
13+
14+
jobs:
15+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
16+
copilot-setup-steps:
17+
runs-on: ubuntu-latest
18+
19+
# Set the permissions to the lowest permissions possible needed for your steps.
20+
# Copilot will be given its own token for its operations.
21+
permissions:
22+
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
23+
# needed to allow julia-actions/cache to delete old caches that it has created
24+
contents: read
25+
actions: write
26+
27+
# You can define any steps you want, and they will run before the agent starts.
28+
# If you do not check out your code, Copilot will do this for you.
29+
steps:
30+
- uses: actions/checkout@v5
31+
- uses: julia-actions/setup-julia@v2
32+
with:
33+
version: "1"
34+
arch: x64
35+
- name: Set JULIA_NUM_THREADS
36+
run: echo "JULIA_NUM_THREADS=auto" >> $GITHUB_ENV
37+
- uses: julia-actions/cache@v2
38+
- uses: julia-actions/julia-buildpkg@v1

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ DynamicPPL = "0.35 - 0.37"
7171
DynarePreprocessor_jll = "6"
7272
FiniteDifferences = "0.12"
7373
ForwardDiff = "0.10, 1"
74-
JET = "0.7 - 0.10"
74+
JET = "0.07 - 0.10"
7575
JSON = "0.21, 1"
7676
Krylov = "0.10"
7777
LaTeXStrings = "1"
@@ -80,7 +80,7 @@ LinearAlgebra = "1"
8080
LinearOperators = "2"
8181
LinearSolve = "3"
8282
LoopVectorization = "0.12"
83-
MCMCChains = "6"
83+
MCMCChains = "6, 7"
8484
MacroTools = "0.5"
8585
MatrixEquations = "2"
8686
NLopt = "0.6, 1"
@@ -104,7 +104,7 @@ SymPyPythonCall = "0.2 - 0.5"
104104
Symbolics = "5, 6"
105105
Test = "1"
106106
ThreadedSparseArrays = "0.2.3"
107-
Turing = "0.30 - 0.40"
107+
Turing = "0.30 - 0.41"
108108
Unicode = "1"
109109
Zygote = "0.6, 0.7"
110110
julia = "1.10"

docs/src/plotting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ and then we plot the IRF for the first shock:
803803
plot_irf(Gali_2015_chapter_3_nonlinear, shocks = shocks[1])
804804

805805
```
806-
and then we overlay the IRF for the remaining shocks using the custom color palette by passing on a dictionnary:
806+
and then we overlay the IRF for the remaining shocks using the custom color palette by passing on a dictionary:
807807
```julia
808808
for s in shocks[2:end]
809809
plot_irf!(Gali_2015_chapter_3_nonlinear, shocks = s, plot_attributes = Dict(:palette => ec_color_palette), plot_type = :stack)

docs/src/unfinished_docs/todo.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
## High priority
44

55
- [ ] write tests/docs/technical details for nonlinear obc, forecasting, (non-linear) solution algorithms, SS solver, obc solver, and other algorithms
6+
- [ ] make sympy optional (maybe even an extension) and use Symbolics where possible
7+
- [ ] collect helper function only used in statsplots extension in that script
8+
- [ ] make package mooncake compatible. write custom pullback functions where necessary (all in one for llh)
69
- [ ] print out th OCB shocks as auxilliary shocks
710
- [ ] generalised higher order IRF is around mean not SSS. plot mean line?
811
- [ ] set irrelevant arguments back to default and inform user
@@ -45,7 +48,6 @@
4548
- [ ] switch from sympy to Symbolics
4649
- [ ] optimize second order estim with SW07 or NAWM
4750
- [ ] optimize third order with smaller model
48-
- [ ] add argument to plotting functions to replace names in plots (e.g. input a dictionary: Dict(:dinve => "Investment growth"))
4951
- [ ] programmatic model writing: accept {i}[0] as definition for variable
5052
- [ ] fix higher order shock finder (3rd order) and check results for pruned second order. are the right state values taken for 1st and second order subprocesses?
5153
- [ ] take analytical derivatives of NSSS funcs to reduce allocation and speed up the NSSS solver
@@ -137,6 +139,7 @@
137139
- [ ] weed out SS solver and saved objects
138140

139141
- [x] add to the doc/strings that KeyedArrays are part of the `AxisKeys` package so people can look up how to access elements there. otherwise they might confuse it for a format provided by the package and wouldnt know how to access elements from it
142+
- [x] add argument to plotting functions to replace names in plots (e.g. input a dictionary: Dict(:dinve => "Investment growth"))
140143
- [x] implement benchmarks
141144
- [x] write non allocating version of steady state functions
142145
- [x] do SVD on matrices before solving first order. idea to solve in lower dimensional subspace. doesn't work as that is the whole point of the solution. what breaks is the X^2 as any transformation of X would have a term in the middle remaining

0 commit comments

Comments
 (0)