-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/staging'
- Loading branch information
Showing
168 changed files
with
9,491 additions
and
898 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
export const ignoreIds = { | ||
domains: [ | ||
"Q3526257", // Thèse d'exercice | ||
"Q913404", // Thèse d'exercice de médecine | ||
"Q669220", // Not available | ||
"Q37033", // w3.org | ||
"Q466", // www | ||
"Q823982", // MathML | ||
"Q142", // française | ||
], | ||
} | ||
|
||
export const institutionsAcronyms = { | ||
"180089013": "CNRS", | ||
"180036048": "INSERM", | ||
"775685019": "CEA", | ||
"180006025": "IRD", | ||
"180070039": "INRAE", | ||
"180089047": "INRIA", | ||
"775665912": "CNES", | ||
"330715368": "IFREMER", | ||
"193112562": "ENAC", | ||
"195922846R": "BRGM", | ||
"775722879": "ONERA", | ||
"775688229": "CSTB", | ||
"331596270": "CIRAD", | ||
"202224326A": "INED", | ||
"385290309": "ADEME", | ||
"130012024": "ANSES", | ||
"130026149": "Univ. PSL", | ||
"196901920": "INSA Lyon", | ||
"196727671": "INSA Strasbourg", | ||
"193500972": "INSA Rennes", | ||
"193101524": "INSA Toulouse", | ||
"130025752": "INSA HDF", | ||
"267500452": "APHP", | ||
"261300081": "APHM", | ||
"197534712": "CNAM", | ||
} | ||
|
||
const institutionsShort = { | ||
"communauté d'universités et établissements": "COMUE", | ||
"communauté d'universités et d'établissements": "COMUE", | ||
"centre hospitalier régional universitaire": "CHRU", | ||
"centre hospitalier et universitaire": "CHU", | ||
"centre hospitalier universitaire": "CHU", | ||
"centre hospitalier régional": "CHR", | ||
"centre hospitalier": "CH", | ||
université: "Univ.", | ||
universite: "Univ.", | ||
university: "Univ.", | ||
institute: "Inst.", | ||
institut: "Inst.", | ||
laboratoire: "Lab.", | ||
laboratory: "Lab.", | ||
"école normale supérieure de": "ENS", | ||
"ecole normale superieure de": "ENS", | ||
} | ||
|
||
function adjustCase(match: string, replacement: string) { | ||
if (match === match.toUpperCase()) { | ||
return replacement.toUpperCase() | ||
} else if (match === match.toLowerCase()) { | ||
return replacement.toLowerCase() | ||
} else { | ||
return replacement | ||
} | ||
} | ||
|
||
export function institutionsReplaceLabel(label: string) { | ||
Object.entries(institutionsShort).forEach(([key, value]) => { | ||
const regex = new RegExp(key, "gi") | ||
label = label.replace(regex, (match) => adjustCase(match, value)) | ||
}) | ||
return label | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { SimpleLinearRegression } from "ml-regression-simple-linear" | ||
|
||
export const linearRegressionSlope = (values, years) => { | ||
const X = years?.map((year) => year - years[0]) | ||
const y = years?.map((year) => values?.[year] || 0.0) | ||
const regression = new SimpleLinearRegression(X, y) | ||
const scores = regression.score(X, y) | ||
|
||
return { slope: regression?.slope, intercept: regression?.intercept, r2: scores.r2 } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default function variation(count, max_year) { | ||
const startValue = count?.[max_year - 1] || 0 | ||
const endValue = count?.[max_year] || 0 | ||
|
||
if (!startValue && !endValue) return 0 | ||
if (!startValue) return Infinity | ||
|
||
return (endValue - startValue) / startValue | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const CONFIG = { | ||
"entity-fishing": { | ||
field: "domains.id_name.keyword", | ||
}, | ||
"open-alex": { | ||
field: "topics.display_name.keyword", | ||
}, | ||
} |
Oops, something went wrong.