Skip to content

Commit 612f27a

Browse files
committed
style change
1 parent cf9100b commit 612f27a

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/systems/buckinghum.jl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ end
2424
get_dims_of_vars(Vector{Any}, Number, Vector{Any})
2525
2626
Gets units of each variable in an array. Returns a matrix where each row corresponds
27-
to binary
28-
Example : kg*m^3
29-
Each index corresponds to length, mass, time, current, luminosity and temperature
30-
respectively.
27+
to units represented in binary values
28+
Example : kg*m^3 - [3, 1, 0, 0, 0, 0]
29+
In the returned value each row corresponds to length, mass, time, current, luminosity
30+
and temperature respectively.
3131
"""
3232
function get_dims_of_vars(dims_vars, total_vars, dim_map)
3333
# For every single variable it contains row of 1s and 0s mentioning which unit is present
@@ -118,9 +118,7 @@ function retrieve_pi_terms(pi_term, var_names)
118118
exp_arr = pi_term["exponents"]
119119
final_pi_term = 1
120120

121-
for (ind, val) in enumerate(exp_arr)
122-
exp_arr[ind] = round(val, digits=2)
123-
end
121+
@. exp_arr = round(exp_arr, digits=2)
124122

125123
for (ind, val) in enumerate(repeating_idx)
126124
final_pi_term *= var_names[val]^exp_arr[ind]

test/buckinghum.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using LinearAlgebra
44
using Test
55

66
@variables f, d, v, ρ, μ
7-
vars1_arr = [ ρ, d, v, μ, f]
7+
vars1_arr = [ρ, d, v, μ, f]
88

99
vars1_quants = [DynamicQuantities.Quantity(0, mass=1, length=-1, time=-1), DynamicQuantities.Quantity(0, length=1) , DynamicQuantities.Quantity(0, length=1, time=-1), DynamicQuantities.Quantity(0, mass=1, length=1, time=-2), DynamicQuantities.Quantity(0, mass=1, length=-1, time=-1)]
1010

@@ -13,7 +13,7 @@ vars1_quants = [DynamicQuantities.Quantity(0, mass=1, length=-1, time=-1), Dynam
1313

1414

1515
@variables a, b, c, d
16-
vars2_arr = [ a, b , c, d]
16+
vars2_arr = [a, b, c, d]
1717

1818
vars2_quants =[DynamicQuantities.Quantity(0, mass=1, length=-3), DynamicQuantities.Quantity(0, mass=1, length=-1, time=-1), DynamicQuantities.Quantity(0, length=1, time=-1), DynamicQuantities.Quantity(0, length=1)]
1919

0 commit comments

Comments
 (0)