CliMA / CliMA/CalibrateEmulateSample.jl

Avoid [x;;] notation in formatted code

Open Beginner friendly
#422 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
90
Forks
16
PR merge metrics
No merged PRs in 30d

Description

## Issue
It appears that the following fails the julia-formatter `.dev/climaformat.jl`

```julia
x = 3.0
one_by_one_mat = [x;;]
```
Instead, julia formatter will convert this to
```julia
x = 3.0
one_by_one_mat = [x] # <- no longer a matrix!
```
Which breaks tests.

## Temporary solution

As this seems to be a funk in the `JuliaFormatter` package rather than the wrapper, I'd advise replacing it with
```
x = 3.0
one_by_one_mat = fill(x,1,1)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting `.dev/climaformat.jl` and searching the repository for `[x;;]`-style one-by-one matrix literals. Replace affected cases with the suggested `fill(x, 1, 1)` form, then run the formatter and the tests that currently break to confirm the result remains a 1×1 matrix.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.