dataesr/scientific-paragraphs-categorization huggingface dataset:
The user only needs to update the call to future::plan(). Furthermore, the future backend provides load balancing so that no cores/units stay idle for too long and the parallelized tasks are split evenly. The package contains a dedicated vignette to guide the users through transforming unparallelized to parallelized code (accessible through vignette("fundiversity_1parallel", package = "fundiversity")). The computation of functional diversity indices often involves null models, which require repeated operations across the same data subsets. This results in computing the same indices over exactly the same assemblages over and over. Memoization can leverage the already computed indices and avoid duplicated work. For example, to compute functional richness (FRic) the convex hull of the input data has to first be identified, and then the volume of this convex hull is computed.
The first step, identifying the convex hull, takes the most time and, as such, storing the results of each computed convex hull can vastly cut computation time for a little memory footprint. If the set of input points is encountered a second time, the results will be taken from memory instead of being recomputed. Memoization trades a little bit of computer memory (keeping the convex hulls stored) for more computation speed. For now, fundiversity leverages memoization only for computing convex hulls (as used when computing FDiv, FRic and FRic_intersect). It is activated by default. This behavior can be overridden by changing the fundiversity. memoise option before loading the package. Packages depend on one another to avoid reinventing the wheel and thus reuse already developed functions. A higher number of dependencies means that a package requires more packages to be installed before its own installation.
While having many dependencies minimizes code replication, it also comes with a high price, because if a single dependency breaks then the whole package cannot be installed anymore  (Cox 2019). Inflated dependencies have been identified as a major risk in software, and  especially in scientific software development  (Claes et al. 2014 , Cox 2019). FD has only four dependencies but other functional diversity packages have many more dependencies (up to 100 dependencies for hypervolume, Supporting information). This renders them quite brittle for the users after years of not being actively developed. fundiversity has been designed to only have minimal external dependencies, it currently depends directly on four, carefully chosen, external packages (details on the criteria of choice in vignette("fundiversity_4design-principles", package = "fundiversity")): future.
If the used data have a high proportion of zeros, using sparse matrices can vastly decrease computational time in fundiversity. As we underlined in the introduction, automatic software testing, while not 100% flawless, is needed to increase the confidence in the behavior of functions. It is widespread in professional software engineering but much less so in scientific software development  (Kanewala and Bieman 2014). This means that software behavior is seldom validated against known inputs to make sure that it behaves in expected ways. This fact does not mean that the software is of poor quality, but rather that some simple errors could introduce unnoticed changes in the behavior of functions. Most packages that compute functional diversity indices do not include any form of automatic testing (only 3 out of 11 do it following our assessment).
We do want to point out that the lack of tests results from the lack of formal training in software development for ecologists  (Farrell and Carey 2018). We designed fundiversity with many unit tests from the beginning, executing at least every single line of code once (i. e. achieving code coverage of 100%). fundiversity mostly computes alpha functional diversity indices, because other recent packages exist to compute other types of functional diversity indices (Hill numbers, Li 2018; beta-diversity indices, Baselga and Orme 2012). We focused on indices available through the dbFD() function in the FD package and on indices that could benefit from faster implementations. The included indices cover the three dimensions of functional diversity: richness (how much total diversity within the set?), evenness (how regularly are species situated along the trait space?) and divergence (how different are species compared to an average position?) (Pavoine and Bonsall 2011).
fundiversity contains the following alpha functional diversity indices: functional richness (FRic), functional dispersion (FDis), functional divergence (FDiv), functional evenness (FEve) and Rao's quadratic entropy (Q). We included Q as we identified the potential for important performance improvements relative to existing packages. fundiversity also contains a beta-diversity index (named FRic_intersect) as it can be useful to compare the overlap between convex hulls between sites. Thanks to its design, fundiversity can be easily extended to include more indices; we include below the list of available indices in the current version of fundiversity. We made sure the indices were numerically exact by using the test dataset available in  Villéger et al. (2008). The functions in fundiversity gave identical results to the one found in Fig.
Case study In this section, we show how to use fundiversity in practice. As an example dataset, we included in fundiversity site-species and trait data from  Nowak et al. (2019). It is accessible through calls to site_sp_birds and traits_ birds when fundiversity is loaded with library() or the use of the data("site_sp_birds", package = "fundiversity") and data("traits_birds", package = "fundiversity") functions when fundiversity is not loaded. This dataset describes the presence/absence of bird species in South America at different elevations and four of their morphological traits. The trait values show species in rows (species are specified as row names) and traits in columns with trait names as column names (Fig. 1 ). Similarly, the site-species matrix contains sites as rows (site names are row names) and species as columns (species names are column names).
Then, we compute the functional richness at each location using the fd_fric() function. It expects quantitative trait values as the first argument and a site-species matrix as the second argument. If the site-species matrix is not provided, fundiversity considers that all species present in the trait matrix are all present in a single site:  (Cardoso et al. 2015) , betapart  (Baselga and Orme 2012) , hillR  (Li 2018) , mFD  (Magneville et al. 2022)  and FD  (Laliberté et al. 2014 ) (see Table  2  for the correspondence between packages). A continuously updated version of this section can be found in the performance comparison vignette within the fundiversity package with vignette("fundiversity_2-performance", package = "fundiversity"). For testing purposes, we used datasets of increasing size with the number of species being 200, 500 or 1000; the number of traits 2, 4 or 10; and the number of sites 50, 100 or 500.
For each set of parameters, we generated a fictional site-species matrix and species-trait matrix containing only continuous traits. We used these simulated data to perform benchmarks across comparable functions (Table  2 ). The benchmark was run 30 times through the bench package (Hester and Vaughan 2021) (Fig. 2 ). The full results detailing the timings for each combination of parameters and functions are available in the Supporting information. For all the indices and functions tested, fundiversity is at least one order of magnitude faster than alternative packages. For functional dispersion (FDis), fundiversity is two orders of magnitude faster compared to BAT and mFD. For functional divergence (FDiv), fundiversity is one order of magnitude faster than mFD. For functional evenness (FEve), fundiversity is two orders of magnitude faster than mFD with sequential and parallelized versions having similar performances.
Memoization creates a cache to avoid recomputing results, and the cache may be corrupted if several cores access the same results at the same time. We noticed that toggling memoization while   performing parallelization severely increases total computational time compared to sequential performance. Note that these benchmarks only assess the packages' computation speed and in no way assess the intrinsic quality or usefulness of any package. We are comparing fundiversity, a package whose main goal is performance, with other packages that may have other primary goals and offer other benefits. For example, several packages offer nice default visualization functions to plot the different diversity indices, while we explicitly considered that visualization functions were not part of fundiversity and let the users decide how they want to plot their indices.
Conclusion We proposed a modern alternative R package to compute functional diversity indices. This package follows current best development practices and leverages modern features like parallelization and memoization to increase its performance. This is only made possible by recent developments that were, for the most part, not available at the time when alternative packages came out. fundiversity does not propose to replace the entire toolkit for the researcher interested in functional diversity (including the upstream selection of the traits and the building of a functional space), but instead focuses on improving the most computationally costly step: computing functional diversity indices. We hope it will be a useful contribution to this toolkit. To ensure its long-term maintainability, we made the package available on GitHub; it is perennially archived on Zenodo; sits in an independent GitHub organization; and is written following clear design principles.
Acknowledgements -Both authors thank  Shan Kothari  and two anonymous reviewers for their comments, which helped improve the manuscript. Funding -M. G. gratefully acknowledges the support of iDiv funded by the  German Research Foundation  ( DFG-FZT 118 ,  202548816 ). The authors acknowledge support from the  iDiv Open Science Publication Fund and from the Open Access Publishing Fund of Leipzig University , which is supported by the  German Research Foundation  within the  program Open Access Publication Funding.
2022). This effort results in the largest catalogue of stellar chemo-physical parameters ever published, which is simultaneously the first of its kind from a space spectroscopic survey and with all-sky coverage. Section 2 presents the GSP-Spec goals and output parameters. This is followed by a description of the input Gaia RVS data (Sect. 3) and reference synthetic spectra grids (Sect. 4). The spectral line selection used for individual abundance analysis is explained in Sect. 5. The two GSP-Spec analysis workflows, Ma-tisseGauguin and artificial neural network (ANN), are described in detail in Sects. 6 and 7, respectively. Section 8 presents the performed validation of GSP-Spec outputs as part of Gaia DR3 operations, and defines the implemented quality flags. Section 9 is devoted to the comparison of GSP-Spec results to literature data and suggested calibrations.
2021) , GALAH-DR3  (Buder et al. 2021) , and the Gaia-ESO Survey (GES)  (Gilmore et al. 2022; Randich et al. 2022 ). The highest number statistics of the Gaia GSP-Spec catalogue is achieved for G<13. 6 mag. For magnitudes fainter than about G∼14. 0, APOGEE dominates with about 100 000 stars. GES also complements Gaia DR3 data at such fainter magnitudes with several tens of thousands, while GALAH has only a few thousand stars fainter than this data release of GSP-Spec. We note that the number of stars parametrised by GSP-Spec will strongly increase with the next Gaia data releases, being about a factor ten larger in DR4 as a result of the spectra signal-to-noise ratio (S/N) increase with repeated observations (and hence with observing time). The GSP-Spec analysis module is coded in Java following DPAC requirements, and is executed at the Data Processing Centre C hosted by the Centre National d'Etudes Spatiales (CNES) in Toulouse, France.
It can be seen from Fig. 14, Fig. E. 1, and Fig. E. 2 that the provided calibrations for the [α/Fe] and individual chemical abundance offsets significantly decrease their gravity dependence (and even remove it completely for several species), and that they set them close to the solar values. Moreover, the comparison with literature data is also improved, reducing the offset and/or the dispersion. The values of the polynomial coefficients of Eq. 3 (p i ) together with their domain of validity in log(g), to avoid extrapolations, are listed in Table  4. We also provide the uncertainties on the polynomial coefficients (derived from the fit) in Table  E. 1, as a possible criterion to evaluate the robustness of the calibration. We note that, for some elements, a lower order polynomial might be sufficient to fit the data, but the verification made on the datasets suggests that we nevertheless correct without overfitting with a third-order polynomial.
Acknowledgements. This work presents results from the  European Space Agency (ESA) space mission Gaia  (https://www. cosmos. esa. int/gaia). Gaia data are processed by the  Gaia Data Processing and Analysis Consortium (DPAC). Funding for the DPAC is provided by national institutions, in particular the institutions participating in the  Gaia MultiLateral Agreement (MLA). The Gaia archive website is https://archives. esac. esa. int/gaia. Acknowledgments from the financial institutions are given in Appendix H. We sincerely thank the stellar atmosphere group in Uppsala for providing the MARCS model atmospheres,  B. Plez  for having developped and maintaining the TURBOSPECTRUM package and,  M. Bergemann  for providing before publication the adopted relation between microturbulent velocity and atmospheric parameters.
We also thank  A. Bragaglia  for her comments on the manuscript and the anonymous referee for very useful comments and suggestions. Finally, part of the calculations have been performed with the high-performance computing facility SIGAMM, hosted by the  Observatoire de la Côte d'Azur. We acknowledge financial supports from the french space agency (CNES),  Agence National de la Recherche  ( ANR 14-CE33-014-01 ) and  Programmes Nationaux de Physique Stellaire & Cosmologie et Galaxies (PNPS & PNCG)  of  CNRS/INSU. ES, ARB, PdL, GK and MS acknowledge funding from the  European Union 's  Horizon 2020 research and innovation program  under  SPACE-H2020  grant agreement number  101004214  ( EXPLORE project ). ANR-10-IDEX-0001-02  for the ' Investissements d'avenir' programme , through grant  ANR-15-CE31-0007  for project ' Modelling the Milky Way in the Gaia era ' (MOD4Gaia), through grant  ANR-14-CE33-0014-01  for project 'The  Milky Way disc formation in the Gaia era ' (ARCHEOGAL), through grant  ANR-15-CE31-0012-01  for project ' Unlocking the potential of Cepheids as primary distance calibrators' (UnlockCepheids ), through grant  ANR-19-CE31-0017  for project ' Secular evolution of galaxies ' (SEGAL), and through grant  ANR-18-CE31-0006  for project ' Galactic Dark Matter' (GaDaMa ), the  Centre National de la Recherche Scientifique (CNRS)  and its  SNO Gaia of the Institut des Sciences de l'Univers (INSU) , its  Programmes Nationaux: Cosmologie et Galaxies (PNCG) ,  Gravitation Références Astronomie Métrologie (PNGRAM) ,  Planétologie (PNP) ,  Physique et Chimie du Milieu Interstellaire (PCMI) , and  Physique Stellaire (PNPS) , the ' Action Fédératrice Gaia ' of the Observatoire de Paris , the  Région de Franche-Comté , the  Institut National Polytechnique (INP)  and the  Institut National de Physique nucléaire et de Physique des Particules  ( IN2P3 ) co-funded by  CNES ; -the  German Aerospace Agency (Deutsches Zentrum für Luft-und Raumfahrt e.
Anders), the  Severo Ochoa Centre of Excellence Programme  ( SEV2015-0493 ), and  MICIN/AEI/10. 13039/501100011033 (and the  European Union  through  European Regional Development Fund 'A way of making Europe')  through grant  RTI2018-095076-B-C21 , the  Institute of Cosmos Sciences University of Barcelona (ICCUB, Unidad de Excelencia 'María de Maeztu ') through grant  CEX2019-000918-M , the  University of Barcelona 's official doctoral programme for the development of an  R+D+i  project through an  Ajuts de Personal Investigador en Formació (APIF) grant , the  Spanish Virtual Observatory  through project  AyA2017-84089 , the  Galician Regional Government, Xunta de Galicia , through grants  ED431B-2021/36 ,  ED481A-2019/155 , and  ED481A-2021/296 , the  Centro de Investigación en Tecnologías de la Información y las Comunicaciones (CITIC) , funded by the  Xunta de Galicia  and the  European Union  ( European Regional Development Fund -Gali -cia 2014-2020 Programme), through grant  ED431G-2019/01 , the  Red Española de Supercomputación (RES) computer resources at MareNostrum , the  Barcelona Supercomputing Centre -Centro Nacional de Supercomputación (BSC-CNS)  through activities  AECT-2017-2-0002 ,  AECT-2017-3-0006 ,  AECT-2018-1-0017 ,  AECT-2018-2-0013 ,  AECT-2018-3-0011 ,  AECT-2019-1-0010 ,  AECT-2019-2-0014 ,  AECT-2019-3-0003 ,  AECT-2020-1-0004 , and  DATA-2020-1-0010 , the  Departament d'Innovació, Universitats i Empresa de la Generalitat de Catalunya  through grant  2014-SGR-1051  for project ' Models de Programació i Entorns d'Execució Parallels' (MPEXPAR) , and  Ramon y Cajal Fellowship   RYC2018-025968-I  funded by  MICIN/AEI/10.
10  (Martin, 2011) , allowing zero mismatches in barcodes or barcode-restriction site remnant combination. Next, the 3′ restriction site remnant and the common adapter sequence of forward reads and the 3′ restriction site remnant, the barcode, and the barcode adapter sequence of reverse reads were removed based on sequence-specific pattern recognition and positional trimming using Cutadapt v2. 10. After trimming the 5′ restriction site remnant of forward and reverse reads using positional trimming in Cutadapt v2. 10, forward and reverse reads with a minimum read length of 60 bp and a minimum overlap of 10 bp were merged using PEAR v0. 9. 11  (Zhang et al. , 2014). Merged reads with a mean base quality below 25 or with more than 5% of the nucleotides uncalled and reads containing internal restriction sites were discarded using GBprocesS.
Finally, merged reads were aligned to the C. canephora reference genome sequence  (Denoeud et al. , 2014)  with the BWA-mem algorithm in BWA v0. 7. 17  (Li, 2013)  with default parameters. Alignments were sorted, indexed, and filtered on mapping quality above 20 with SAMtools 1. 10  (Li et al. , 2009). Next, high-quality GBS loci and Stack Mapping Anchor Points (SMAPs) were identified in the mapped reads using the SMAP delineate module within the SMAP package v4. 4. 0  (Schaumont et al. ,.
SNP calling Single nucleotide polymorphisms (SNPs) were called with GATK (Genome Analysis Toolkit) Unified Genotyper v3. 7. 0  (McKenna et al. , 2010). SNP calling was the same for GBS and HiPlex (see below). Only SNPs within high-quality GBS loci as identified with the SMAP delineate module, for GBS read data, or within the 86 high-quality HiPlex loci, for HiPlex read data, were retained. SNPs were filtered using the following parameters: min-meanDP 30, mac 4, and minQ 20, and multi-allelic SNPs were removed with GATK. The remaining SNPs were then subjected to further filtering with the following parameters: minDP 10, minGQ 30, minQ 30, min-alleles 2, max-alleles 2, and maf 0. 05 using VCFtools v0. 1. 16  (Danecek et al. , 2011). Only SNPs with a minimum read depth of 10 were retained using a customized Python3 script.
Read-backed haplotyping was conducted with the SMAP haplotype-sites module based on the SNPs within the 86 high-quality HiPlex loci for both GBS and HiPlex read data. On a per-sample basis, all haplotype calls derived from GBS data were compared to those of HiPlex data across the 86 high-quality HiPlex loci (Figure  3A ). Since the selection of HiPlex loci can introduce bias in the calculation of genetic distances between all pairs of samples and the population structure is calculated on these genetic distances, we calibrated whether pairwise JID calculated on GBS data (Figure  3B ) was correlated to that based on HiPlex data (Figure  3C ). Pairwise JID was calculated with the same parameters as above (see Genetic similarity), once based on the GBS data within all polymorphic highquality GBS loci and once based on the HiPlex data within the 86 high-quality HiPlex loci.
Fossoriality has evolved from fully quadrupedal ancestors at least five times independently, which demonstrates that even complex morphological syndromesin this case involving traits such as limb regression, body elongation, modification of cephalic scalation, depigmentation, and eyes and ear-opening regressioncan evolve repeatedly and independently given enough time and eco-evolutionary advantages. Initial diversification of the group likely occurred in forests, and the divergence of sand-swimmer genera around 20 Ma appears linked to a period of aridification. Our results show that the large phenotypic variability of Malagasy Scincinae has not influenced diversification rate and that their rich species diversity results from a constant accumulation of lineages through time. By compiling large geographic and trait-related datasets together with the computation of a new time tree for the group, our study contributes important insights on the diversification of Malagasy vertebrates.
This radiation endemic to Madagascar and neighbouring islands (see 2. 1 Samples and dataset) has recently been the object of intensive systematic and taxonomic research, with several species described over the last three decades (e. g. ,  Raxworthy and Nussbaum, 1993; Andreone and Greer, 2002; Köhler et al. , 2009; Miralles et al. , 2011a Miralles et al. , , 2011b Miralles et al. , , 2011c Miralles et al. , , 2012 Miralles et al. , , 2016a Miralles et al. , , 2016b)) , and the knowledge of their phylogenetic relationships that has greatly improved (e. g. ,  Crottini et al. , 2009; Erens et al. , 2017; Köhler et al. , 2010; Miralles et al. , 2015; Miralles and Vences, 2013; Schmitz et al. , 2005; Whiting et al. , 2004). Their richness and variety emphasise Madagascar's status as a global hotspot for skink diversity  (Chapple et al.
, 2015). Despite recent progress in the study of Malagasy Scincinae, we are still lacking a comprehensive characterisation of the in situ diversification of the group. Following the recent systematic and taxonomic advances outlined above and the availability of a large number of new samples, it is now possible to infer a new phylogenetic hypothesis of the group based on a more complete dataset (both in terms of number of included taxa and loci). The availability of this dataset makes the estimation of divergence times more reliable, which is, in turn, fundamental to performing informative macroevolutionary analyses within a robust phylogenetic and statistical framework. Using new macroevolutionary tools that have become available recently (e. g. ,  Beaulieu and O'Meara, 2016; Harvey and Rabosky, 2018; Höhna et al.
Samples and dataset Malagasy Scincinae comprise 65 described species in nine genera: Amphiglossus, Brachyseps, Flexiseps, Grandidierina, Madascincus, Paracontias, Pseudoacontias, Pygomeles, and Voeltzkowia (Fig. 1 ; Supplementary Table  S1 ;  Glaw and Vences, 2007; Uetz et al. , 2022). The genus Mesomycterus Cope 1892 has recently been proposed to be an older synonym of Brachyseps  Erens et al. , 2017 (Shea, 2021) , but since it has not been used in the literature since its description, it qualifies as nomen oblitum  (Uetz et al. , 2022) , and it is not considered in this study. Most species belonging to the Malagasy Scincinae are restricted to Madagascar, although two species of Flexiseps are endemic to the neighbouring islands of Mayotte and Glorioso  (Glaw and Vences, 2007; Uetz et al. , 2022).