Skip to content

Commit 5ff0267

Browse files
committed
FIX: Logging
1 parent 755033b commit 5ff0267

File tree

2 files changed

+54
-12
lines changed

2 files changed

+54
-12
lines changed

Examples/Notebook.ipynb

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,35 @@
1010
},
1111
{
1212
"cell_type": "code",
13-
"execution_count": 24,
13+
"execution_count": 1,
1414
"id": "6ef0e461",
1515
"metadata": {},
16-
"outputs": [],
16+
"outputs": [
17+
{
18+
"name": "stdout",
19+
"output_type": "stream",
20+
"text": [
21+
"\n",
22+
"## You are using the Python ARM Radar Toolkit (Py-ART), an open source\n",
23+
"## library for working with weather radar data. Py-ART is partly\n",
24+
"## supported by the U.S. Department of Energy as part of the Atmospheric\n",
25+
"## Radiation Measurement (ARM) Climate Research Facility, an Office of\n",
26+
"## Science user facility.\n",
27+
"##\n",
28+
"## If you use this software to prepare a publication, please cite:\n",
29+
"##\n",
30+
"## JJ Helmus and SM Collis, JORS 2016, doi: 10.5334/jors.119\n",
31+
"\n",
32+
"\n",
33+
"## Cite PyScanCf:\n",
34+
"\n",
35+
"## Syed, H. A., Sayyed, I., Kalapureddy, M. C. R., & Grandhi, K. K. (2021).\n",
36+
"## PyScanCf – The library for individual sweep datasets of IMD weather radars.\n",
37+
"## Zenodo. https://doi.org/10.5281/zenodo.5574160\n",
38+
"\n"
39+
]
40+
}
41+
],
1742
"source": [
1843
"import os\n",
1944
"import glob\n",
@@ -25,7 +50,7 @@
2550
},
2651
{
2752
"cell_type": "code",
28-
"execution_count": 4,
53+
"execution_count": 2,
2954
"id": "702fa56e",
3055
"metadata": {},
3156
"outputs": [
@@ -48,7 +73,7 @@
4873
},
4974
{
5075
"cell_type": "code",
51-
"execution_count": 5,
76+
"execution_count": 3,
5277
"id": "8b09c9e3",
5378
"metadata": {},
5479
"outputs": [
@@ -98,28 +123,41 @@
98123
},
99124
{
100125
"cell_type": "code",
101-
"execution_count": 25,
126+
"execution_count": 4,
102127
"id": "fad28716",
103128
"metadata": {},
104129
"outputs": [],
105130
"source": [
106131
"input_dir = target_dir\n",
107-
"out_dir = \"outdir\""
132+
"out_dir = \"outdir\"\n",
133+
"!rm -rf $out_dir"
108134
]
109135
},
110136
{
111137
"cell_type": "code",
112-
"execution_count": 26,
138+
"execution_count": 5,
113139
"id": "70266985",
114140
"metadata": {},
115-
"outputs": [],
141+
"outputs": [
142+
{
143+
"name": "stderr",
144+
"output_type": "stream",
145+
"text": [
146+
"2025-04-18 14:31:02,754 - INFO - Packing 10 sweeps into 1 volumes\n",
147+
"2025-04-18 14:31:02,755 - INFO - Processing volume 1\n",
148+
"2025-04-18 14:31:04,000 - INFO - Saved cfrad_GOA210516024101-IMD-B.nc\n",
149+
"2025-04-18 14:31:04,001 - INFO - Data merging done \n",
150+
"Total Time Elapsed: 0:00:05.284940\n"
151+
]
152+
}
153+
],
116154
"source": [
117155
"pcf.cfrad(input_dir, out_dir,)"
118156
]
119157
},
120158
{
121159
"cell_type": "code",
122-
"execution_count": 31,
160+
"execution_count": 6,
123161
"id": "13cfd4a3",
124162
"metadata": {},
125163
"outputs": [
@@ -129,7 +167,7 @@
129167
"['outdir/cfrad_GOA210516024101-IMD-B.nc']"
130168
]
131169
},
132-
"execution_count": 31,
170+
"execution_count": 6,
133171
"metadata": {},
134172
"output_type": "execute_result"
135173
}
@@ -141,7 +179,7 @@
141179
},
142180
{
143181
"cell_type": "code",
144-
"execution_count": 40,
182+
"execution_count": 7,
145183
"id": "0376ccdc",
146184
"metadata": {},
147185
"outputs": [

pyscancf/pyscancf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
from .utils import parse_fields
2121

2222
warnings.filterwarnings("ignore", category=DeprecationWarning)
23+
logging.basicConfig(
24+
level=logging.INFO,
25+
format="%(asctime)s - %(levelname)s - %(message)s"
26+
)
2327
tstart = datetime.now()
2428

2529

@@ -220,4 +224,4 @@ def cfrad(
220224
del radar, grid
221225
else:
222226
pass
223-
logging.info(f"Data merging done \nTotal Time Elapsed: {datetime.now() - tstart}")
227+
logging.info(f"Data merging done \nTime Taken: {datetime.now() - tstart}")

0 commit comments

Comments
 (0)