pep8: Change to respect pep8 code style.

This commit is contained in:
Pierre-Antoine Rouby committed 2023-12-11 14:40:54 +01:00
1 parent 1ab1cb37b0
commit eea355a784
31 files changed
+169 -98

No files matched your search

+23 -7
View File
@@ -453,9 +453,20 @@ class Mage(CommandLineSolver):
for hs in hydraulic_structures:
if hs.reach.is_enable:
reach_id = study.river.get_edge_id(hs.reach)
params = [p.value for p in hs.basic_hydraulic_structure.param]
param_str = ' '.join([f'{p.value:>10.3f}' for p in hs.basic_hydraulic_structure.param])
f.write(f"{hs.basic_hydraulic_structure.type} {reach_id} {hs.kp:>12.3f} {params} {hs.name}\n")
params = [
p.value for p in hs.basic_hydraulic_structure.param
]
param_str = ' '.join(
[
f'{p.value:>10.3f}'
for p in hs.basic_hydraulic_structure.param
]
)
f.write(
f"{hs.basic_hydraulic_structure.type} " +
f"{reach_id} {hs.kp:>12.3f} {params} " +
"{hs.name}\n"
)
return files
@@ -465,7 +476,11 @@ class Mage(CommandLineSolver):
qlog.put("Export REP file")
# Write header
with mage_file_open(os.path.join(repertory, f"{name}.REP"), "w+") as f:
with mage_file_open(
os.path.join(
repertory, f"{name}.REP"
), "w+"
) as f:
f.write("confirmation=non\n")
for file in files:
@@ -832,12 +847,13 @@ class Mage8(Mage):
# Set data for profile RI
reach.set(ri, timestamp, key, d)
if key == "Z":
profile = study.river.current_reach().reach.profile(ri)
ptX,ptY = profile.get_water_limits(d)
profile = study.river\
.current_reach()\
.reach.profile(ri)
ptX, ptY = profile.get_water_limits(d)
reach.set(ri, timestamp, "ptX", ptX)
reach.set(ri, timestamp, "ptY", ptY)
endline()
end = newline().size <= 0