Climatemachine.jl: Possible issue with climaformat.jl after Merge 1172

Created on 4 Jun 2020  路  5Comments  路  Source: CliMA/ClimateMachine.jl

Description

The commit listed below (Merge #1172) has possibly broken climaformat.jl as shown in the error trace posted below the commit:

commit 7f9d08dc66c1c0068c57b4f7778b7f68000bab3f (origin/master, origin/HEAD, master)
Merge: 03850273a 6e1b7786b
Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Date:   Thu Jun 4 13:51:03 2020 +0000

    Merge #1172

Steps to reproduce

Steps to reproduce the behavior:

  1. Output of git log -1. In the case of bugs from code that has significantly diverged from master, a separate branch can be created and linked.
commit bfbf19eff9aaf57b84cc16556d65953fb4437aa3 (HEAD -> sm/mountain-waves, origin/sm/mountain-waves)
Author: Simone Marras <[email protected]>
Date:   Wed May 27 03:36:43 2020 -0700

    Mountain gravity waves:
    - hydrostatic linear and non-linear setups
    - removed agnesi-equilibrium.jl. IT will be added with its own PR.
    - Smagorinsky run with  0.23
    - Formatted
    - Reduced time end to avoid wave issue after the flow went through a few times
    - Replaced ClimateMachine.init() with ClimateMachine.cli() after merging with 7f9d08dc66c1c0068c57b4f7778b7f68000bab3f

This is PR #1163

  1. Exact sequence of commands run (REPL, terminal, or script) to reproduce this issue issue.
  2. Expected runtime for issue/bug to reveal itself (particularly useful in the case of problems with physics / set-ups that require longer time to solution)

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem, otherwise please remove this section. This can be particularly useful for physical simulations.

Environment and error messages

  • Backtrace of error message
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] #format_text#86(::Int64, ::Int64, ::Bool, ::Bool, ::Bool, ::Bool, ::DefaultStyle, ::typeof(format_text), ::String) at /home/smarras/.julia/packages/JuliaFormatter/5Boao/src/JuliaFormatter.jl:291
 [3] #format_text at ./none:0 [inlined]
 [4] #format_file#87(::Bool, ::Bool, ::Int64, ::Int64, ::Bool, ::Bool, ::Bool, ::Bool, ::DefaultStyle, ::typeof(format_file), ::String) at /home/smarras/.julia/packages/JuliaFormatter/5Boao/src/JuliaFormatter.jl:380
 [5] #format_file at ./none:0 [inlined]
 [6] #format#88(::Base.Iterators.Pairs{Symbol,Integer,NTuple{6,Symbol},NamedTuple{(:indent, :margin, :always_for_in, :whitespace_typedefs, :whitespace_ops_in_indices, :remove_extra_newlines),Tuple{Int64,Int64,Bool,Bool,Bool,Bool}}}, ::typeof(format), ::Array{String,1}) at /home/smarras/.julia/packages/JuliaFormatter/5Boao/src/JuliaFormatter.jl:453
 [7] (::JuliaFormatter.var"#kw##format")(::NamedTuple{(:indent, :margin, :always_for_in, :whitespace_typedefs, :whitespace_ops_in_indices, :remove_extra_newlines),Tuple{Int64,Int64,Bool,Bool,Bool,Bool}}, ::typeof(format), ::Array{String,1}) at ./none:0
 [8] top-level scope at /home/smarras/software/CLIMA/.dev/climaformat.jl:86
 [9] include at ./boot.jl:328 [inlined]
 [10] include_relative(::Module, ::String) at ./loading.jl:1105
 [11] include(::Module, ::String) at ./Base.jl:31
 [12] exec_options(::Base.JLOptions) at ./client.jl:287
 [13] _start() at ./client.jl:460
in expression starting at /home/smarras/software/CLIMA/.dev/climaformat.jl:86
  • Include output of julia> versioninfo()
Julia Version 1.3.1
Commit 2d5741174c (2019-12-30 21:36 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Xeon(R) Gold 6230 CPU @ 2.10GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_MPI_PATH = /home/user/mylibs/mpich-3.3.1/build_intel

Additional context

Add any other context about the problem here.

For CLIMA developers

  • [ ] The bug can be reproduced
  • [ ] Labels have been added and developers assigned
  • [ ] The bug can be fixed (if not, please explain why not in a comment below)
  • [ ] There is a timeline to fix the bug
  • [ ] The bug has been fixed (Please link the PR)
bug

Most helpful comment

fair enough, but a space after before a parenthesis is not a bug in the real sense. It is a syntax error due to a wrong format of the text in the file. Anyway, that solved it.

A space before a parenthesis is a bug in julia. Since the code won't run.

julia> f() = nothing
f (generic function with 1 method)

julia> f ()
ERROR: syntax: space before "(" not allowed in "f (" at REPL[2]:1
Stacktrace:
 [1] top-level scope at REPL[1]:0

All 5 comments

Problem is with the file not the formatter

ClimateMachine.cli ()

should have no space

ClimateMachine.cli()

in tutorials/Atmos/agnesi_hs_lin.jl

Shouldn't the formatter identify these issues and fix them?

issues solved.

Shouldn't the formatter identify these issues and fix them?

The formatter only works on syntactically correct julia code. It cannot fix bugs

fair enough, but a space after before a parenthesis is not a bug in the real sense. It is a syntax error due to a wrong format of the text in the file. Anyway, that solved it.

A space before a parenthesis is a bug in julia. Since the code won't run.

julia> f() = nothing
f (generic function with 1 method)

julia> f ()
ERROR: syntax: space before "(" not allowed in "f (" at REPL[2]:1
Stacktrace:
 [1] top-level scope at REPL[1]:0
Was this page helpful?
0 / 5 - 0 ratings

Related issues

bischtob picture bischtob  路  7Comments

trontrytel picture trontrytel  路  8Comments

akshaysridhar picture akshaysridhar  路  9Comments

glwagner picture glwagner  路  3Comments

jkozdon picture jkozdon  路  9Comments