Skip to content

Commit 7f62dae

Browse files
committed
fix: fixed style in templates
1 parent 13ebddd commit 7f62dae

File tree

2 files changed

+30
-22
lines changed

2 files changed

+30
-22
lines changed

src/hydrodiy/io/script_template_plot.py

+15-11
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

44
[COMMENT]
55

6-
import sys, os, re, json, math
6+
import sys
7+
import os
8+
import re
9+
import json
10+
import math
711
import argparse
812
from pathlib import Path
913

@@ -40,9 +44,9 @@
4044
#import importlib
4145
#importlib.reload(utils)
4246

43-
#----------------------------------------------------------------------
47+
# ----------------------------------------------------------------------
4448
# @Config
45-
#----------------------------------------------------------------------
49+
# ----------------------------------------------------------------------
4650

4751
parser = argparse.ArgumentParser(\
4852
description="[DESCRIPTION]", \
@@ -80,26 +84,26 @@
8084
# Manage projection
8185
#proj = pyproj.Proj("+init=EPSG:{0}".format(args.projection))
8286
#
83-
#----------------------------------------------------------------------
87+
# ----------------------------------------------------------------------
8488
# @Folders
85-
#----------------------------------------------------------------------
89+
# ----------------------------------------------------------------------
8690
source_file = Path(__file__).resolve()
8791

8892
froot = [FROOT]
8993
fdata = [FDATA]
9094
fout = [FOUT]
9195
fimg = [FIMG]
9296

93-
#------------------------------------------------------------
97+
# ------------------------------------------------------------
9498
# @Logging
95-
#------------------------------------------------------------
99+
# ------------------------------------------------------------
96100
basename = source_file.stem
97101
LOGGER = iutils.get_logger(basename)
98102
LOGGER.log_dict(vars(args), "Command line arguments")
99103

100-
#------------------------------------------------------------
104+
# ------------------------------------------------------------
101105
# @Get data
102-
#------------------------------------------------------------
106+
# ------------------------------------------------------------
103107
#fd = "%s/data.csv" % FDATA
104108
#data, comment = csv.read_csv(fd)
105109

@@ -108,9 +112,9 @@
108112
mess = "{0} sites found".format(sites.shape[0])
109113
LOGGER.info(mess)
110114

111-
#------------------------------------------------------------
115+
# ------------------------------------------------------------
112116
# @Plot
113-
#------------------------------------------------------------
117+
# ------------------------------------------------------------
114118

115119
# To use multipage pdf
116120
#fpdf = fimg / "images.pdf"

src/hydrodiy/io/script_template_simple.py

+15-11
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

44
[COMMENT]
55

6-
import sys, os, re, json, math
6+
import sys
7+
import os
8+
import re
9+
import json
10+
import math
711
import argparse
812
from pathlib import Path
913

@@ -23,9 +27,9 @@
2327
#foo = importlib.util.module_from_spec(spec)
2428
#spec.loader.exec_module(foo)
2529

26-
#----------------------------------------------------------------------
30+
# ----------------------------------------------------------------------
2731
# @Config
28-
#----------------------------------------------------------------------
32+
# ----------------------------------------------------------------------
2933
parser = argparse.ArgumentParser(\
3034
description="[DESCRIPTION]", \
3135
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
@@ -58,27 +62,27 @@
5862
debug = args.debug
5963
sitepattern = args.sitepattern
6064

61-
#----------------------------------------------------------------------
65+
# ----------------------------------------------------------------------
6266
# @Folders
63-
#----------------------------------------------------------------------
67+
# ----------------------------------------------------------------------
6468
source_file = Path(__file__).resolve()
6569
froot = [FROOT]
6670
fdata = [FDATA]
6771
fout = [FOUT]
6872
fimg = [FIMG]
6973

70-
#----------------------------------------------------------------------
74+
# ----------------------------------------------------------------------
7175
# @Logging
72-
#----------------------------------------------------------------------
76+
# ----------------------------------------------------------------------
7377
basename = source_file.stem
7478
flog = froot / "logs" / f"{basename}.log"
7579
flog.parent.mkdir(exist_ok=True)
7680
LOGGER = iutils.get_logger(basename, console=False, contextual=True)
7781
LOGGER.log_dict(vars(args), "Command line arguments")
7882

79-
#----------------------------------------------------------------------
83+
# ----------------------------------------------------------------------
8084
# @Get data
81-
#----------------------------------------------------------------------
85+
# ----------------------------------------------------------------------
8286
fs = fdata / "sites.csv"
8387
allsites, _ = csv.read_csv(fs, index_col="siteid")
8488

@@ -92,9 +96,9 @@
9296
idx = iutils.get_ibatch(allsites.shape[0], nbatch, ibatch)
9397
sites = allsites.iloc[idx, :]
9498

95-
#----------------------------------------------------------------------
99+
# ----------------------------------------------------------------------
96100
# @Process
97-
#----------------------------------------------------------------------
101+
# ----------------------------------------------------------------------
98102
nsites = len(sites)
99103
for isite, (siteid, sinfo) in enumerate(sites.iterrows()):
100104

0 commit comments

Comments
 (0)