Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
limbra
limbra
Commits
6adcbb7e
Commit
6adcbb7e
authored
Feb 06, 2020
by
LE GAC Renaud
Browse files
Update Automaton._search_parameters to improve dates handling for inspirehep.
parent
21d028a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
modules/harvest_tools/automaton.py
modules/harvest_tools/automaton.py
+7
-6
No files found.
modules/harvest_tools/automaton.py
View file @
6adcbb7e
...
...
@@ -321,14 +321,15 @@ class Automaton(object):
query
=
collection
if
year_start
and
not
year_end
:
query
+=
" and date
%s"
%
year_start
query
+=
f
" and date
{
year_start
}
"
elif
not
year_start
and
year_end
:
query
+=
" and date
%s"
%
year_end
query
+=
f
" and date
{
year_end
}
"
elif
year_start
and
year_end
:
query
+=
" and date > %s and date < %s "
\
%
(
year_start
-
1
,
year_end
+
1
)
tpl
=
(
f
"date
{
el
}
"
for
el
in
range
(
year_start
,
year_end
+
1
))
sdates
=
" or "
.
join
(
tpl
)
query
+=
f
" and (
{
sdates
}
)"
dic
=
dict
(
p
=
query
,
# query à la spires
rg
=
1000
,
# maximum number of records returned
...
...
@@ -354,8 +355,8 @@ class Automaton(object):
rex
=
year_end
elif
year_start
and
year_end
:
l
i
=
[
str
(
el
)
for
el
in
range
(
year_start
,
year_end
+
1
)
]
rex
=
"|"
.
join
(
l
i
)
tp
l
=
(
str
(
el
)
for
el
in
range
(
year_start
,
year_end
+
1
)
)
rex
=
"|"
.
join
(
tp
l
)
dic
=
dict
(
cc
=
collection
,
# collection
f1
=
"year"
,
# search on year
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment