researcher¶
researcher ¶
Researcher dataclass ¶
One researcher's data, in the shape shared by both A3 rows and iMarina rows once parsed - the common representation build diffs between the previous iMarina upload and the latest A3 dump.
Source code in source/src/imarina_load_researchers/core/researcher.py
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | |
__post_init__ ¶
Fills any unset institutional/contact field with ICIQ's fixed default value (INSTITUTIONAL_DEFAULTS).
Source code in source/src/imarina_load_researchers/core/researcher.py
__str__ ¶
Multi-line, human-readable dump of every field, used for logger.debug calls.
Source code in source/src/imarina_load_researchers/core/researcher.py
copy ¶
Returns an independent copy of this researcher.
Returns:
| Name | Type | Description |
|---|---|---|
Researcher | Researcher | A new |
search_data ¶
Finds this researcher's match(es) in another list of researchers.
Matches by is_same_person (ORCID, then DNI, then email). If more than one match is found, the results are narrowed down to those that also share this researcher's ini_date, when that narrows the set to exactly one; otherwise every is_same_person match is returned as-is.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_input | list[Researcher] | The researchers to search among (typically the A3 or iMarina researcher list). | required |
Returns:
| Type | Description |
|---|---|
list[Researcher] | list[Researcher]: The matching researcher(s), or |
Source code in source/src/imarina_load_researchers/core/researcher.py
is_same_person ¶
Whether self and other represent the same person.
Matches on the first of ORCID, DNI or email that both researchers have a (non-empty) value for.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
other | Researcher | The researcher to compare against. | required |
Returns:
| Name | Type | Description |
|---|---|---|
bool | bool |
|
Source code in source/src/imarina_load_researchers/core/researcher.py
has_changed_jobs ¶
Whether self (the new A3 position) counts as a job change from researcher (the outgoing iMarina position).
JOB_TITLE_POSTDOCTORAL_RESEARCHER/JOB_TITLE_ASSOCIATED_RESEARCHER and JOB_TITLE_GROUP_LEADER/JOB_TITLE_GROUP_LEADER_ICREA are treated as equivalent pairs, not a job change.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
researcher | Researcher | The researcher's previous (iMarina) position. | required |
Returns:
| Name | Type | Description |
|---|---|---|
bool | bool |
|
Source code in source/src/imarina_load_researchers/core/researcher.py
is_visitor ¶
Whether this researcher is a short-term visitor, who shouldn't be loaded into iMarina.
Center code 4 (VISITOR_CENTER_CODE) generally marks a visitor, but ICREA group leaders and CSC-scholarship predoctoral researchers are also filed under code 4 despite not being visitors. Per policy, code-4 people should be disambiguated using their ini/end date span (a real visit is under about a year) - the job-description keyword check below only catches the ICREA case (title contains "leader"), not CSC predocs, since a predoc's title doesn't match any of PERMANENT_POSITION_KEYWORDS.
NOTE: the duration check described above isn't implemented for the code_center == VISITOR_CENTER_CODE branch - only the keyword check is. This means a code-4 CSC predoc is currently misclassified as a visitor. Flagging this since it doesn't match the policy above - fix if that's unintentional.
Source code in source/src/imarina_load_researchers/core/researcher.py
normalize_name ¶
Normalizes a researcher's (first/sur)name to title case.
Only converts names that are entirely uppercase or entirely lowercase (as A3/iMarina exports often are); a name with mixed case is assumed to already be correctly cased and is left untouched.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name | str | The raw name value. | required |
Returns:
| Name | Type | Description |
|---|---|---|
str | str | The title-cased name, stripped of surrounding whitespace, or |