Skip to content

Commit

Permalink
fix: spelling mistakes (using codespell)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Strömer committed Nov 19, 2024
1 parent ea2089d commit f0ee235
Show file tree
Hide file tree
Showing 20 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if is_local_draft
import Revise
Revise.revise()
catch
@warn "Building documentation without Revise support. If you want to automatically refresh docstrings from withing IESopt.jl, you need Revise installed."
@warn "Building documentation without Revise support. If you want to automatically refresh docstrings from within IESopt.jl, you need Revise installed."
end
end

Expand Down
4 changes: 2 additions & 2 deletions docs/src/pages/dev_docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Documenter.jl (as of May, 22nd, 2024) aggressively states: _"Documenter, like an
Unfortunately, [semantic versioning](https://semver.org/) may not be as well suited as one might think for a package like IESopt.jl. Some reasons are:

- While the (Julia) API has been stable for a long time (in a sense of: backwards-compatible), we consider the YAML configuration syntax as main part of IESopt's "API". This syntax has changed multiple times, and will likely change in the future. Maintaining full backwards compatibility for this is not feasible all the time. This induces a need for a major version bump, even though the Julia API has not changed.
- A mere bug fix, even a small one, in IESopt.jl may very likely induce changed results of any model run. A user could see vastly different results between `v1.3.10` and `v1.3.11`, even though the changes are minimal. This envolves not taking patch updates lightly, which is not the case in many other packages.
- A mere bug fix, even a small one, in IESopt.jl may very likely induce changed results of any model run. A user could see vastly different results between `v1.3.10` and `v1.3.11`, even though the changes are minimal. This involves not taking patch updates lightly, which is not the case in many other packages.

However, as indicated, the use of semantic versioning is still "expected" by large parts of the Julia community, and not doing so may make it harder for some users, and/or some interactions with other packages. So...

Expand Down Expand Up @@ -136,7 +136,7 @@ We provide a custom `.JuliaFormatter.toml` file that should be used to format th
2. Run `using JuliaFormatter` in the Julia REPL (this now works even if you activated the IESopt environment).
3. Run `format(".")` in the Julia REPL to format all files in your current directory. This takes a bit of compile time, but after the first run, it should be fairly fast.
Make sure you checked the formatting, before finalizing your changes or opening a PR. If you forgot to include formatting in your actual commits (we all do...), and cannot reasonably ammend them, add **all** formatting changes at the end in a single commit with the message:
Make sure you checked the formatting, before finalizing your changes or opening a PR. If you forgot to include formatting in your actual commits (we all do...), and cannot reasonably amend them, add **all** formatting changes at the end in a single commit with the message:
```console
git commit -m "chore: formatting"
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/tutorials/templates_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A template is defined by a YAML file, similar to the `config.iesopt.yaml` file t
think about the parameters that we want to define for our heat pump. Let's create a new file for that. The pre-defined
one is called `HeatPump`, so we need a different name: Templates must always have a unique name.

Possiblities for that could be:
Possibilities for that could be:

- `CustomHeatPump`, if you do not have any more details
- `GroundSourceHeatPump`, if we want to implement a ground-source heat pump with different parameters/features than the
Expand Down
4 changes: 2 additions & 2 deletions src/assets/examples/04_soft_constraints.iesopt.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This example demonstrates the effect and use of the inbuilt "constraint safety" feature. This artifically alters
# This example demonstrates the effect and use of the inbuilt "constraint safety" feature. This artificially alters
# constraints inside the core components, in order to (hopefully) catch infeasibilities during the optimization run,
# returning a (partially) valid solution as well as an indication where the infeasibility occurs.
# Comments indicate points of this model file that changed compared to the previous examples. All other elements are not
Expand Down Expand Up @@ -29,7 +29,7 @@ config:
active: true
# This parameterizes the cost of utilizing the safety feature. This should be much higher than other costs in the
# objective function and defaults to 1e15. This, while being a rather safe number - meaning it most likely will not
# interfer in any wrong way with your model - comes at the cost of numerical instability. This can be handled
# interfere in any wrong way with your model - comes at the cost of numerical instability. This can be handled
# "properly" by some solvers (like Gurobi) but will negatively impact others (like GLPK). To counter this we can
# specify a lower cost coefficient here. Consider setting a lower tolerance for these solvers, for example call
# `JuMP.set_optimizer_attribute(model, "tol_dj", 1e-12)` for GLPK.
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/09_csv_only.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ load_components:

# You can also use `- .csv` to load all CSV files in the folder.

# Even when loading components from external CSV files, you can specify addtional ones like normal. IESopt takes
# Even when loading components from external CSV files, you can specify additional ones like normal. IESopt takes
# care about merging them correctly.
components:
co2_emissions:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/27_piecewise_linear_costs.iesopt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ components:
conversion: ~ -> 1 electricity
# The following constructs the piecewise linear function, including a constant offset of 5 (given as calculation!).
# We expect the first 5 to be "free", the next 10 to cost "10 each", then "20 each", and the remaining 5 (so that
# the demand of 30 can be covered) "30 each". That makes total sytem cost of 100 + 200 + 150 = 450.
# the demand of 30 can be covered) "30 each". That makes total system cost of 100 + 200 + 150 = 450.
capacity: 10.0/2 + build_gas_1:value + build_gas_2:value + build_gas_3:value out:electricity

demand:
Expand Down
2 changes: 1 addition & 1 deletion src/assets/examples/files/18/Example18.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function construct_constraints!(model::JuMP.Model, config::Dict)

# This enables you to return `false` if something went wrong. If an error occurs, please also use
# `@error "[MyAddonName] My error message" additional_parameter=42`
# to provide addtional info before returning `false`. You can of course always also utilize the remaining Julia
# to provide additional info before returning `false`. You can of course always also utilize the remaining Julia
# logging functions. Please make sure to start all logging messages with `[MyAddonName]`.

@info "[IESoptAddon_Example18] Finished constructing constraint."
Expand Down
2 changes: 1 addition & 1 deletion src/core/connection/var_flow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function _connection_var_flow!(connection::Connection)
@critical "Representative Snapshots are currently not supported for models using Powerflow"
end

# This is a passive Conection.
# This is a passive Connection.
@simd for t in get_T(model)
# Construct the flow expression.
JuMP.add_to_expression!(connection.exp.pf_flow[t], node_from.var.pf_theta[t], 1.0 / connection.pf_X)
Expand Down
2 changes: 1 addition & 1 deletion src/core/decision.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function _result(decision::Decision, mode::String, field::String; result::Int=1)
end

if field in ["size", "count"]
@error "`decision:size` and `decision:count` are deprecated and most likely do not work as exepected; please change to extracting `decision:value`" decision =
@error "`decision:size` and `decision:count` are deprecated and most likely do not work as expected; please change to extracting `decision:value`" decision =
decision.name mode = mode
end

Expand Down
2 changes: 1 addition & 1 deletion src/parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ function _parse_components_csv!(
# Is this a global parameter that we should fill in automatically?
if !isnothing(internal(model).input.parameters) && haskey(internal(model).input.parameters, k)
if warnlogcount == 0
@warn "You left a field empty in a CSV component defintion file that corresponds to a global parameter. Automatic replacement is happening. Did you really intend this?" component =
@warn "You left a field empty in a CSV component definition file that corresponds to a global parameter. Automatic replacement is happening. Did you really intend this?" component =
name property = k
warnlogcount += 1
end
Expand Down
6 changes: 3 additions & 3 deletions src/utils/docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ function _docs_struct_to_table(datatype::Type)
# Get proper binding from module, error if structure is unexpected.
binding = Base.Docs.aliasof(datatype, typeof(datatype))
dict = Base.Docs.meta(binding.mod; autoinit=false)
isnothing(dict) && @critical "Doc error occured" datatype
haskey(dict, binding) || @critical "Doc error occured" datatype dict binding
isnothing(dict) && @critical "Doc error occurred" datatype
haskey(dict, binding) || @critical "Doc error occurred" datatype dict binding
multidoc = dict[binding]
haskey(multidoc.docs, Union{}) || @critical "Doc error occured" datatype multidoc.docs
haskey(multidoc.docs, Union{}) || @critical "Doc error occurred" datatype multidoc.docs

# Get all fields that have a docstring.
all_doc_fields = multidoc.docs[Union{}].data[:fields]
Expand Down
8 changes: 4 additions & 4 deletions src/utils/general.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ function _mapexpr_addon(expr::Expr, reload::Bool)
end

if expr.args[3].head != :block
# The actual stuff inside the module defintion is not a block.
# The actual stuff inside the module definition is not a block.
error(
"Failed loading addon (ERROR_CODE 3); make sure the file only contains a single module definition that wraps all your code",
)
Expand Down Expand Up @@ -216,12 +216,12 @@ function _load_or_retrieve_addon_file(filename::String; reload::Bool)
(module_addon isa Module) && return module_addon
end

@error "An error occured while trying to load an addon file" addon_file_name = filename
@error "An error occurred while trying to load an addon file" addon_file_name = filename
@error "The loaded code did not return a valid module; make sure the file only contains a single module definition that wraps all your code"
catch e
@error "An error occured while trying to load an addon file" addon_file_name = filename
@error "An error occurred while trying to load an addon file" addon_file_name = filename
@error string(e.error)
@error "The error seems to have occured here" file = e.file line = e.line
@error "The error seems to have occurred here" file = e.file line = e.line
end

@critical "Error while loading addons, see above for details"
Expand Down
2 changes: 1 addition & 1 deletion src/validation/core/carrier.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function _validate_carriers(carriers::Dict)
try
# TODO
catch exception
valid &= _vassert(false, "An unexpected exception occured"; location="carriers")
valid &= _vassert(false, "An unexpected exception occurred"; location="carriers")
end

return valid
Expand Down
2 changes: 1 addition & 1 deletion src/validation/core/connection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function _validate_connection(name::String, properties::Dict)
try
# TODO
catch exception
valid &= _vassert(false, "An unexpected exception occured"; location="Connection", name=name)
valid &= _vassert(false, "An unexpected exception occurred"; location="Connection", name=name)
end

return valid
Expand Down
2 changes: 1 addition & 1 deletion src/validation/core/decision.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function _validate_decision(name::String, properties::Dict)
try
# TODO
catch exception
valid &= _vassert(false, "An unexpected exception occured"; location="Decision", name=name)
valid &= _vassert(false, "An unexpected exception occurred"; location="Decision", name=name)
end

return valid
Expand Down
2 changes: 1 addition & 1 deletion src/validation/core/node.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function _validate_node(name::String, properties::Dict)
try
# TODO
catch exception
valid &= _vassert(false, "An unexpected exception occured"; location="Node", name=name)
valid &= _vassert(false, "An unexpected exception occurred"; location="Node", name=name)
end

return valid
Expand Down
2 changes: 1 addition & 1 deletion src/validation/core/profile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function _validate_profile(name::String, properties::Dict)
try
# TODO
catch exception
valid &= _vassert(false, "An unexpected exception occured"; location="Profile", name=name)
valid &= _vassert(false, "An unexpected exception occurred"; location="Profile", name=name)
end

return valid
Expand Down
2 changes: 1 addition & 1 deletion src/validation/core/snapshot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function _validate_snapshots(carriers::Dict)
try
# TODO
catch exception
valid &= _vassert(false, "An unexpected exception occured"; location="snapshots")
valid &= _vassert(false, "An unexpected exception occurred"; location="snapshots")
end

return valid
Expand Down
2 changes: 1 addition & 1 deletion src/validation/core/template.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function _validate_template_component(name::String, properties::Dict)
try
# TODO
catch exception
valid &= _vassert(false, "An unexpected exception occured"; location=properties["type"], name=name)
valid &= _vassert(false, "An unexpected exception occurred"; location=properties["type"], name=name)
end

return valid
Expand Down
2 changes: 1 addition & 1 deletion src/validation/core/unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function _validate_unit(name::String, properties::Dict)
try
# TODO
catch exception
valid &= _vassert(false, "An unexpected exception occured"; location="Unit", name=name)
valid &= _vassert(false, "An unexpected exception occurred"; location="Unit", name=name)
end

return valid
Expand Down

0 comments on commit f0ee235

Please sign in to comment.