Skip to content

Commit 6cae3a7

Browse files
authored
fix: fixed style in templates (#31)
* fix: fixed style in templates * fix: fixed grid (#30) * fix: fixed grid * fix: fixed style for gutils and oz * fix: fixed style in io files * fix: fixed style of iutils * fix: fixed style for template + removed some plot commands * fix: fixed style for boxplot * fix: reconcile rebase
1 parent 813d98e commit 6cae3a7

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

src/hydrodiy/io/script_template_plot.py

+10-11
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@
4444
# Select backend
4545
mpl.use("Agg")
4646

47-
#----------------------------------------------------------------------
47+
# ----------------------------------------------------------------------
4848
# @Config
49-
#----------------------------------------------------------------------
50-
49+
# ----------------------------------------------------------------------
5150
parser = argparse.ArgumentParser(description="[DESCRIPTION]",
5251
formatter_class=
5352
argparse.ArgumentDefaultsHelpFormatter)
@@ -84,26 +83,26 @@
8483
# Manage projection
8584
#proj = pyproj.Proj("+init=EPSG:{0}".format(args.projection))
8685
#
87-
#----------------------------------------------------------------------
86+
# ----------------------------------------------------------------------
8887
# @Folders
89-
#----------------------------------------------------------------------
88+
# ----------------------------------------------------------------------
9089
source_file = Path(__file__).resolve()
9190

9291
froot = [FROOT]
9392
fdata = [FDATA]
9493
fout = [FOUT]
9594
fimg = [FIMG]
9695

97-
#------------------------------------------------------------
96+
# ------------------------------------------------------------
9897
# @Logging
99-
#------------------------------------------------------------
98+
# ------------------------------------------------------------
10099
basename = source_file.stem
101100
LOGGER = iutils.get_logger(basename)
102101
LOGGER.log_dict(vars(args), "Command line arguments")
103102

104-
#------------------------------------------------------------
103+
# ------------------------------------------------------------
105104
# @Get data
106-
#------------------------------------------------------------
105+
# ------------------------------------------------------------
107106
#fd = "%s/data.csv" % FDATA
108107
#data, comment = csv.read_csv(fd)
109108

@@ -112,9 +111,9 @@
112111
mess = "{0} sites found".format(sites.shape[0])
113112
LOGGER.info(mess)
114113

115-
#------------------------------------------------------------
114+
# ------------------------------------------------------------
116115
# @Plot
117-
#------------------------------------------------------------
116+
# ------------------------------------------------------------
118117

119118
# To use multipage pdf
120119
#fpdf = fimg / "images.pdf"

src/hydrodiy/io/script_template_simple.py

+15-12
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,13 +27,12 @@
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(description="[DESCRIPTION]",
3034
formatter_class=
3135
argparse.ArgumentDefaultsHelpFormatter)
32-
3336
parser.add_argument("-v", "--version",
3437
help="Version number",
3538
type=int, required=True)
@@ -58,27 +61,27 @@
5861
debug = args.debug
5962
sitepattern = args.sitepattern
6063

61-
#----------------------------------------------------------------------
64+
# ----------------------------------------------------------------------
6265
# @Folders
63-
#----------------------------------------------------------------------
66+
# ----------------------------------------------------------------------
6467
source_file = Path(__file__).resolve()
6568
froot = [FROOT]
6669
fdata = [FDATA]
6770
fout = [FOUT]
6871
fimg = [FIMG]
6972

70-
#----------------------------------------------------------------------
73+
# ----------------------------------------------------------------------
7174
# @Logging
72-
#----------------------------------------------------------------------
75+
# ----------------------------------------------------------------------
7376
basename = source_file.stem
7477
flog = froot / "logs" / f"{basename}.log"
7578
flog.parent.mkdir(exist_ok=True)
7679
LOGGER = iutils.get_logger(basename, console=False, contextual=True)
7780
LOGGER.log_dict(vars(args), "Command line arguments")
7881

79-
#----------------------------------------------------------------------
82+
# ----------------------------------------------------------------------
8083
# @Get data
81-
#----------------------------------------------------------------------
84+
# ----------------------------------------------------------------------
8285
fs = fdata / "sites.csv"
8386
allsites, _ = csv.read_csv(fs, index_col="siteid")
8487

@@ -92,9 +95,9 @@
9295
idx = iutils.get_ibatch(allsites.shape[0], nbatch, ibatch)
9396
sites = allsites.iloc[idx, :]
9497

95-
#----------------------------------------------------------------------
98+
# ----------------------------------------------------------------------
9699
# @Process
97-
#----------------------------------------------------------------------
100+
# ----------------------------------------------------------------------
98101
nsites = len(sites)
99102
for isite, (siteid, sinfo) in enumerate(sites.iterrows()):
100103

0 commit comments

Comments
 (0)