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
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
limbra
limbra
Commits
0028fb1c
Commit
0028fb1c
authored
Apr 30, 2021
by
LE GAC Renaud
Browse files
Update AuthorsMixin.is_affiliation_for_all to add a threshold
parent
813338e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
modules/store_tools/authorsmixin.py
modules/store_tools/authorsmixin.py
+11
-2
No files found.
modules/store_tools/authorsmixin.py
View file @
0028fb1c
...
@@ -15,6 +15,8 @@ AUTHOR_FORMATS = [
...
@@ -15,6 +15,8 @@ AUTHOR_FORMATS = [
"Last, First"
,
"Last, First"
,
"Last F."
]
"Last F."
]
AFF_THRESHOLD
=
0.01
MSG_FAUTHOR_COLLABORATION
=
"Reject first author is a Collaboration"
MSG_FAUTHOR_COLLABORATION
=
"Reject first author is a Collaboration"
MSG_INVALID_FMT
=
"Invalid format for author"
MSG_INVALID_FMT
=
"Invalid format for author"
MSG_NO_AUTHOR
=
"Reject no author(s)"
MSG_NO_AUTHOR
=
"Reject no author(s)"
...
@@ -373,7 +375,12 @@ class AuthorsMixin(object):
...
@@ -373,7 +375,12 @@ class AuthorsMixin(object):
return
True
return
True
def
is_affiliation_for_all
(
self
):
def
is_affiliation_for_all
(
self
):
"""``True`` when affiliation are defined for all authors.
"""``True`` when affiliation are defined for almost all authors.
Note:
Very often affiliation are missing. Therefore, if the number
of affiliation is at least define for 99% of authors we
consider that the publication is OK.
Return:
Return:
bool:
bool:
...
@@ -382,7 +389,9 @@ class AuthorsMixin(object):
...
@@ -382,7 +389,9 @@ class AuthorsMixin(object):
df
=
self
.
df_authors
df
=
self
.
df_authors
query
=
df
.
affiliation
.
isin
([
""
,
NaN
])
query
=
df
.
affiliation
.
isin
([
""
,
NaN
])
return
df
.
affiliation
[
query
].
size
==
0
frac
=
df
.
affiliation
[
query
].
size
/
df
.
affiliation
.
size
return
frac
<=
AFF_THRESHOLD
def
is_authors
(
self
):
def
is_authors
(
self
):
"""``True`` when authors are defined.
"""``True`` when authors are defined.
...
...
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