Skip to content

Commit a92fc91

Browse files
committed
chore: run pre-commit locally
1 parent 97b945b commit a92fc91

46 files changed

Lines changed: 1001 additions & 438 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@
145145

146146
# One entry per manual page. List of tuples
147147
# (source start file, name, description, authors, manual section).
148-
man_pages = [(master_doc, "pygeofilter", "pygeofilter Documentation", [author], 1)]
148+
man_pages = [
149+
(master_doc, "pygeofilter", "pygeofilter Documentation", [author], 1)
150+
]
149151

150152

151153
# -- Options for Texinfo output ----------------------------------------------

examples/cql2.ipynb

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
"metadata": {},
88
"outputs": [],
99
"source": [
10-
"from pygeofilter.parsers.cql2_json import parse\n",
11-
"from pygeofilter.backends.cql2_json import to_cql2\n",
1210
"import json\n",
1311
"import traceback\n",
14-
"from lark import lark, logger, v_args\n",
15-
"from pygeofilter.cql2 import BINARY_OP_PREDICATES_MAP\n"
12+
"\n",
13+
"from pygeofilter.backends.cql2_json import to_cql2"
1614
]
1715
},
1816
{
@@ -34,7 +32,10 @@
3432
],
3533
"source": [
3634
"from pygeofilter.parsers.cql2_text import parse as cql2_parse\n",
37-
"cql2_parse(\"collection = 'landsat8_l1tp' AND gsd <= 30 AND eo:cloud_cover <= 10 AND datetime >= TIMESTAMP('2021-04-08T04:39:23Z')\")"
35+
"\n",
36+
"cql2_parse(\n",
37+
" \"collection = 'landsat8_l1tp' AND gsd <= 30 AND eo:cloud_cover <= 10 AND datetime >= TIMESTAMP('2021-04-08T04:39:23Z')\"\n",
38+
")"
3839
]
3940
},
4041
{
@@ -99,51 +100,52 @@
99100
}
100101
],
101102
"source": [
102-
"from pygeofilter.parsers.cql2_text import parse as text_parse\n",
103-
"from pygeofilter.parsers.cql2_json import parse as json_parse\n",
104-
"from pygeofilter.backends.cql2_json import to_cql2\n",
105103
"import orjson\n",
106-
"import json\n",
107-
"import pprint\n",
104+
"\n",
105+
"from pygeofilter.parsers.cql2_json import parse as json_parse\n",
106+
"from pygeofilter.parsers.cql2_text import parse as text_parse\n",
107+
"\n",
108+
"\n",
108109
"def pp(j):\n",
109110
" print(orjson.dumps(j))\n",
110-
"with open('tests/parsers/cql2_json/fixtures.json') as f:\n",
111+
"\n",
112+
"\n",
113+
"with open(\"tests/parsers/cql2_json/fixtures.json\") as f:\n",
111114
" examples = json.load(f)\n",
112115
"\n",
113116
"for k, v in examples.items():\n",
114117
" parsed_text = None\n",
115118
" parsed_json = None\n",
116-
" print (k)\n",
117-
" t=v['text'].replace('filter=','')\n",
118-
" j=v['json']\n",
119+
" print(k)\n",
120+
" t = v[\"text\"].replace(\"filter=\", \"\")\n",
121+
" j = v[\"json\"]\n",
119122
" # print('\\t' + t)\n",
120123
" # pp(orjson.loads(j))\n",
121124
" # print('*****')\n",
122125
" try:\n",
123-
" parsed_text=text_parse(t)\n",
124-
" parsed_json=json_parse(j)\n",
126+
" parsed_text = text_parse(t)\n",
127+
" parsed_json = json_parse(j)\n",
125128
" if parsed_text == parsed_json:\n",
126-
" print('*******parsed trees match***************')\n",
129+
" print(\"*******parsed trees match***************\")\n",
127130
" else:\n",
128131
" print(parsed_text)\n",
129-
" print('-----')\n",
132+
" print(\"-----\")\n",
130133
" print(parsed_json)\n",
131134
" if parsed_json is None or parsed_text is None:\n",
132135
" raise Exception\n",
133136
" if to_cql2(parsed_text) == to_cql2(parsed_json):\n",
134-
" print('*******reconstructed json matches*******')\n",
137+
" print(\"*******reconstructed json matches*******\")\n",
135138
" else:\n",
136139
" pp(to_cql2(parsed_text))\n",
137-
" print('-----')\n",
140+
" print(\"-----\")\n",
138141
" pp(to_cql2(parsed_json))\n",
139142
" except Exception as e:\n",
140143
" print(parsed_text)\n",
141144
" print(parsed_json)\n",
142145
" print(j)\n",
143146
" traceback.print_exc(f\"Error: {e}\")\n",
144147
" pass\n",
145-
" print('____________________________________________________________')\n",
146-
" "
148+
" print(\"____________________________________________________________\")"
147149
]
148150
},
149151
{

0 commit comments

Comments
 (0)