diff --git a/docs/source/notebooks/advanced_visualizations.ipynb b/docs/source/notebooks/advanced_visualizations.ipynb index 4d728eb9..541aa5e7 100644 --- a/docs/source/notebooks/advanced_visualizations.ipynb +++ b/docs/source/notebooks/advanced_visualizations.ipynb @@ -221,7 +221,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -235,7 +235,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.9" + "version": "3.12.0" } }, "nbformat": 4, diff --git a/docs/source/notebooks/bulk_data_access.ipynb b/docs/source/notebooks/bulk_data_access.ipynb index 55c9ade3..df6a14f9 100644 --- a/docs/source/notebooks/bulk_data_access.ipynb +++ b/docs/source/notebooks/bulk_data_access.ipynb @@ -8,25 +8,39 @@ "\n", "This tutorial explains how to retrieve full tables from the database into [pandas DataFrames](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.html).\n", "\n", - "## The following tables are available from ``mendeleev``\n", + "## Available tables in ``mendeleev``\n", "\n", - "* elements\n", - "* ionicradii\n", - "* ionizationenergies\n", - "* oxidationstates\n", - "* groups\n", - "* series\n", - "* isotopes\n", + "- [elements](#elements): The main table with element properties\n", + "- [groups](#groups): Metadata about periodic table groups\n", + "- [ionicradii](#ionicradii): Ionic radii data\n", + "- [ionizationenergies](#ionizationenergies): Ionization energies\n", + "- [isotopes](#isotopes): Isotopes and their properties\n", + "- [isotopedecaymodes](#isotopedecaymodes): Data on isotope decay modes\n", + "- [oxidationstates](#oxidationstates): Oxidation states for elements\n", + "- [phasetransitions](#phasetransitions): Phase transition data for elements\n", + "- [propertymetadata](#propertymetadata): Metadata about properties from all tables\n", + "- [scattering_factors](#scattering_factors): Atomic scattering factors\n", + "- [screeningconstants](#screeningconstants): Nuclear screening constants\n", + "- [series](#series): Metadata about periodic table series\n", "\n", "All data is stored in a sqlite database that is shipped together with the package. You can interact directly with the database if you need more flexibility but for convenience ``mendeleev`` provides a few functions in the `fetch` module to\n", "retrieve data.\n", "\n", + "## Fetching computed properties in bulk\n", + "\n", + "- [Electronegativities](#Electronegativities) A collection of [electronegativity](https://mendeleev.readthedocs.io/en/stable/electronegativity.html) scales computed based on other properties." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ "To fetch whole tables you can use `fetch_table`. The function can be imported from `mendeleev.fetch`" ] }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "collapsed": false, "jupyter": { @@ -45,9 +59,16 @@ "To retrieve a table call the ``fetch_table`` with the table name as argument. Here we'll get probably the most important table ``elements`` with basis data on each element" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## elements" + ] + }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": { "collapsed": false, "jupyter": { @@ -68,98 +89,14 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "RangeIndex: 118 entries, 0 to 117\n", - "Data columns (total 70 columns):\n", - " # Column Non-Null Count Dtype \n", - "--- ------ -------------- ----- \n", - " 0 annotation 118 non-null object \n", - " 1 atomic_number 118 non-null int64 \n", - " 2 atomic_radius 90 non-null float64\n", - " 3 atomic_volume 91 non-null float64\n", - " 4 block 118 non-null object \n", - " 5 boiling_point 96 non-null float64\n", - " 6 density 95 non-null float64\n", - " 7 description 109 non-null object \n", - " 8 dipole_polarizability 117 non-null float64\n", - " 9 electron_affinity 77 non-null float64\n", - " 10 electronic_configuration 118 non-null object \n", - " 11 evaporation_heat 88 non-null float64\n", - " 12 fusion_heat 75 non-null float64\n", - " 13 group_id 90 non-null float64\n", - " 14 lattice_constant 87 non-null float64\n", - " 15 lattice_structure 91 non-null object \n", - " 16 melting_point 100 non-null float64\n", - " 17 name 118 non-null object \n", - " 18 period 118 non-null int64 \n", - " 19 series_id 118 non-null int64 \n", - " 20 specific_heat 81 non-null float64\n", - " 21 symbol 118 non-null object \n", - " 22 thermal_conductivity 66 non-null float64\n", - " 23 vdw_radius 103 non-null float64\n", - " 24 covalent_radius_cordero 96 non-null float64\n", - " 25 covalent_radius_pyykko 118 non-null float64\n", - " 26 en_pauling 85 non-null float64\n", - " 27 en_allen 71 non-null float64\n", - " 28 jmol_color 109 non-null object \n", - " 29 cpk_color 103 non-null object \n", - " 30 proton_affinity 32 non-null float64\n", - " 31 gas_basicity 32 non-null float64\n", - " 32 heat_of_formation 89 non-null float64\n", - " 33 c6 43 non-null float64\n", - " 34 covalent_radius_bragg 37 non-null float64\n", - " 35 vdw_radius_bondi 28 non-null float64\n", - " 36 vdw_radius_truhlar 16 non-null float64\n", - " 37 vdw_radius_rt 9 non-null float64\n", - " 38 vdw_radius_batsanov 65 non-null float64\n", - " 39 vdw_radius_dreiding 21 non-null float64\n", - " 40 vdw_radius_uff 103 non-null float64\n", - " 41 vdw_radius_mm3 94 non-null float64\n", - " 42 abundance_crust 88 non-null float64\n", - " 43 abundance_sea 81 non-null float64\n", - " 44 molcas_gv_color 103 non-null object \n", - " 45 en_ghosh 103 non-null float64\n", - " 46 vdw_radius_alvarez 94 non-null float64\n", - " 47 c6_gb 86 non-null float64\n", - " 48 atomic_weight 118 non-null float64\n", - " 49 atomic_weight_uncertainty 74 non-null float64\n", - " 50 is_monoisotopic 21 non-null object \n", - " 51 is_radioactive 118 non-null bool \n", - " 52 cas 118 non-null object \n", - " 53 atomic_radius_rahm 96 non-null float64\n", - " 54 geochemical_class 76 non-null object \n", - " 55 goldschmidt_class 118 non-null object \n", - " 56 metallic_radius 56 non-null float64\n", - " 57 metallic_radius_c12 63 non-null float64\n", - " 58 covalent_radius_pyykko_double 108 non-null float64\n", - " 59 covalent_radius_pyykko_triple 80 non-null float64\n", - " 60 discoverers 118 non-null object \n", - " 61 discovery_year 105 non-null float64\n", - " 62 discovery_location 106 non-null object \n", - " 63 name_origin 118 non-null object \n", - " 64 sources 118 non-null object \n", - " 65 uses 112 non-null object \n", - " 66 mendeleev_number 118 non-null int64 \n", - " 67 dipole_polarizability_unc 117 non-null float64\n", - " 68 pettifor_number 103 non-null float64\n", - " 69 glawe_number 103 non-null float64\n", - "dtypes: bool(1), float64(46), int64(4), object(19)\n", - "memory usage: 63.8+ KB\n" - ] - } - ], + "outputs": [], "source": [ "ptable.info()" ] @@ -173,7 +110,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -189,107 +126,14 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
atomic_numbersymbolatomic_radiusen_paulingblockvdw_radius_mm3
01H25.02.20s162.0
12He120.0NaNs153.0
23Li145.00.98s255.0
34Be105.01.57s223.0
45B85.02.04p215.0
\n", - "
" - ], - "text/plain": [ - " atomic_number symbol atomic_radius en_pauling block vdw_radius_mm3\n", - "0 1 H 25.0 2.20 s 162.0\n", - "1 2 He 120.0 NaN s 153.0\n", - "2 3 Li 145.0 0.98 s 255.0\n", - "3 4 Be 105.0 1.57 s 223.0\n", - "4 5 B 85.0 2.04 p 215.0" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "ptable[cols].head()" ] @@ -303,119 +147,14 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
atomic_numberatomic_radiusen_paulingvdw_radius_mm3
count118.00000090.00000085.00000094.000000
mean59.500000149.8444441.748588248.468085
std34.20769940.0791100.63444236.017828
min1.00000025.0000000.700000153.000000
25%30.250000135.0000001.240000229.000000
50%59.500000145.0000001.700000244.000000
75%88.750000178.7500002.160000269.250000
max118.000000260.0000003.980000364.000000
\n", - "
" - ], - "text/plain": [ - " atomic_number atomic_radius en_pauling vdw_radius_mm3\n", - "count 118.000000 90.000000 85.000000 94.000000\n", - "mean 59.500000 149.844444 1.748588 248.468085\n", - "std 34.207699 40.079110 0.634442 36.017828\n", - "min 1.000000 25.000000 0.700000 153.000000\n", - "25% 30.250000 135.000000 1.240000 229.000000\n", - "50% 59.500000 145.000000 1.700000 244.000000\n", - "75% 88.750000 178.750000 2.160000 269.250000\n", - "max 118.000000 260.000000 3.980000 364.000000" - ] - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "ptable[cols].describe()" ] @@ -424,14 +163,106 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Isotopes table\n", + "## groups\n", + "\n", + "Periodic table group metadata." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "groups = fetch_table(\"groups\")\n", + "groups" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## ionicradii\n", + "\n", + "The function to fetch ionic radii is called `fetch_ionic_radii` and can either fetch ionic or crystal radii depending on the `radius` argument." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from mendeleev.fetch import fetch_ionic_radii" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "irs = fetch_ionic_radii(radius=\"ionic_radius\")\n", + "irs.head(10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## ionizationenergies\n", + "\n", + "To fetch ionization energies use `fetch_ionization_energies` that takes a `degree` (default is `degree=1`) argument that can either be a single integer or a list if integers to fetch multiple ionization energies." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from mendeleev.fetch import fetch_ionization_energies" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ies = fetch_ionization_energies(degree=2)\n", + "ies.head(10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To fetch multiple ionization degress at once simply pass a list of degrees:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "ies_multiple = fetch_ionization_energies(degree=[1, 3, 5])\n", + "ies_multiple.head(10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## isotopes\n", "\n", "Let try and retrieve another table, namely ``isotopes``" ] }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": { "collapsed": false, "jupyter": { @@ -445,43 +276,34 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "Int64Index: 406 entries, 1 to 406\n", - "Data columns (total 11 columns):\n", - " # Column Non-Null Count Dtype \n", - "--- ------ -------------- ----- \n", - " 0 atomic_number 406 non-null int64 \n", - " 1 mass 377 non-null float64\n", - " 2 abundance 288 non-null float64\n", - " 3 mass_number 406 non-null int64 \n", - " 4 mass_uncertainty 377 non-null float64\n", - " 5 is_radioactive 406 non-null bool \n", - " 6 half_life 121 non-null float64\n", - " 7 half_life_unit 85 non-null object \n", - " 8 spin 323 non-null float64\n", - " 9 g_factor 323 non-null float64\n", - " 10 quadrupole_moment 320 non-null float64\n", - "dtypes: bool(1), float64(7), int64(2), object(1)\n", - "memory usage: 35.3+ KB\n" - ] - } - ], + "outputs": [], "source": [ "isotopes.info()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here's a few first records from that dataframe" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "isotopes.head(10)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -493,7 +315,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -502,7 +324,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": { "collapsed": false, "jupyter": { @@ -523,225 +345,28 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "Int64Index: 406 entries, 0 to 405\n", - "Data columns (total 16 columns):\n", - " # Column Non-Null Count Dtype \n", - "--- ------ -------------- ----- \n", - " 0 atomic_number 406 non-null int64 \n", - " 1 symbol 406 non-null object \n", - " 2 atomic_radius 328 non-null float64\n", - " 3 en_pauling 313 non-null float64\n", - " 4 block 406 non-null object \n", - " 5 vdw_radius_mm3 350 non-null float64\n", - " 6 mass 377 non-null float64\n", - " 7 abundance 288 non-null float64\n", - " 8 mass_number 406 non-null int64 \n", - " 9 mass_uncertainty 377 non-null float64\n", - " 10 is_radioactive 406 non-null bool \n", - " 11 half_life 121 non-null float64\n", - " 12 half_life_unit 85 non-null object \n", - " 13 spin 323 non-null float64\n", - " 14 g_factor 323 non-null float64\n", - " 15 quadrupole_moment 320 non-null float64\n", - "dtypes: bool(1), float64(10), int64(2), object(3)\n", - "memory usage: 51.1+ KB\n" - ] - } - ], + "outputs": [], "source": [ "merged.info()" ] }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
atomic_numbersymbolatomic_radiusen_paulingblockvdw_radius_mm3massabundancemass_numbermass_uncertaintyis_radioactivehalf_lifehalf_life_unitsping_factorquadrupole_moment
01H25.02.2s162.01.0078250.99972016.000000e-10FalseNaNNone0.55.5856950.00000
11H25.02.2s162.02.0141020.00028028.000000e-10FalseNaNNone1.00.8574380.00286
21H25.02.2s162.0NaNNaN3NaNTrueNaNNone0.55.9579940.00000
32He120.0NaNs153.03.0160290.00000232.000000e-08FalseNaNNone0.5-4.2549950.00000
42He120.0NaNs153.04.0026030.99999844.000000e-10FalseNaNNone0.00.0000000.00000
\n", - "
" - ], - "text/plain": [ - " atomic_number symbol atomic_radius en_pauling block vdw_radius_mm3 \\\n", - "0 1 H 25.0 2.2 s 162.0 \n", - "1 1 H 25.0 2.2 s 162.0 \n", - "2 1 H 25.0 2.2 s 162.0 \n", - "3 2 He 120.0 NaN s 153.0 \n", - "4 2 He 120.0 NaN s 153.0 \n", - "\n", - " mass abundance mass_number mass_uncertainty is_radioactive \\\n", - "0 1.007825 0.999720 1 6.000000e-10 False \n", - "1 2.014102 0.000280 2 8.000000e-10 False \n", - "2 NaN NaN 3 NaN True \n", - "3 3.016029 0.000002 3 2.000000e-08 False \n", - "4 4.002603 0.999998 4 4.000000e-10 False \n", - "\n", - " half_life half_life_unit spin g_factor quadrupole_moment \n", - "0 NaN None 0.5 5.585695 0.00000 \n", - "1 NaN None 1.0 0.857438 0.00286 \n", - "2 NaN None 0.5 5.957994 0.00000 \n", - "3 NaN None 0.5 -4.254995 0.00000 \n", - "4 NaN None 0.0 0.000000 0.00000 " - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "merged.head()" ] @@ -755,137 +380,14 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "metadata": { "collapsed": false, "jupyter": { "outputs_hidden": false } }, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
atomic_numbersymbolatomic_radiusen_paulingblockvdw_radius_mm3massabundancemass_numbermass_uncertaintyis_radioactivehalf_lifehalf_life_unitsping_factorquadrupole_moment
2814Si110.01.9p229.027.9769270.92191283.000000e-09FalseNaNNone0.00.000000.0
2914Si110.01.9p229.028.9764950.04699293.000000e-09FalseNaNNone0.5-1.110580.0
3014Si110.01.9p229.029.9737700.03110302.000000e-08FalseNaNNone0.00.000000.0
\n", - "
" - ], - "text/plain": [ - " atomic_number symbol atomic_radius en_pauling block vdw_radius_mm3 \\\n", - "28 14 Si 110.0 1.9 p 229.0 \n", - "29 14 Si 110.0 1.9 p 229.0 \n", - "30 14 Si 110.0 1.9 p 229.0 \n", - "\n", - " mass abundance mass_number mass_uncertainty is_radioactive \\\n", - "28 27.976927 0.92191 28 3.000000e-09 False \n", - "29 28.976495 0.04699 29 3.000000e-09 False \n", - "30 29.973770 0.03110 30 2.000000e-08 False \n", - "\n", - " half_life half_life_unit spin g_factor quadrupole_moment \n", - "28 NaN None 0.0 0.00000 0.0 \n", - "29 NaN None 0.5 -1.11058 0.0 \n", - "30 NaN None 0.0 0.00000 0.0 " - ] - }, - "execution_count": 14, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "merged[merged[\"symbol\"] == \"Si\"]" ] @@ -894,572 +396,127 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "## Ionic radii\n", + "## isotopedecaymodes\n", "\n", - "The function to fetch ionic radii is called `fetch_ionic_radii` and can either fetch ionic or crystal radii depending on the `radius` argument." + "Different modes are explained in [the documentation](https://mendeleev.readthedocs.io/en/stable/data.html#isotope-decay-modes)" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "from mendeleev.fetch import fetch_ionic_radii" + "idm = fetch_table(\"isotopedecaymodes\")\n", + "idm" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## oxidationstates" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
coordinationIIIIIIIIIPYIVIVPYIVSQIXVVIVIIVIIIXXIXIIXIV
atomic_numbercharge
11-38.0-18.0NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
31NaNNaNNaNNaN59.0NaNNaNNaNNaN76.0NaN92.0NaNNaNNaNNaN
42NaNNaN16.0NaN27.0NaNNaNNaNNaN45.0NaNNaNNaNNaNNaNNaN
53NaNNaN1.0NaN11.0NaNNaNNaNNaN27.0NaNNaNNaNNaNNaNNaN
64NaNNaN-8.0NaN15.0NaNNaNNaNNaN16.0NaNNaNNaNNaNNaNNaN
7-3NaNNaNNaNNaN146.0NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
3NaNNaNNaNNaNNaNNaNNaNNaNNaN16.0NaNNaNNaNNaNNaNNaN
5NaNNaN-10.4NaNNaNNaNNaNNaNNaN13.0NaNNaNNaNNaNNaNNaN
8-2NaN135.0136.0NaN138.0NaNNaNNaNNaN140.0NaN142.0NaNNaNNaNNaN
9-1NaN128.5130.0NaN131.0NaNNaNNaNNaN133.0NaNNaNNaNNaNNaNNaN
\n", - "
" - ], - "text/plain": [ - "coordination I II III IIIPY IV IVPY IVSQ IX V \\\n", - "atomic_number charge \n", - "1 1 -38.0 -18.0 NaN NaN NaN NaN NaN NaN NaN \n", - "3 1 NaN NaN NaN NaN 59.0 NaN NaN NaN NaN \n", - "4 2 NaN NaN 16.0 NaN 27.0 NaN NaN NaN NaN \n", - "5 3 NaN NaN 1.0 NaN 11.0 NaN NaN NaN NaN \n", - "6 4 NaN NaN -8.0 NaN 15.0 NaN NaN NaN NaN \n", - "7 -3 NaN NaN NaN NaN 146.0 NaN NaN NaN NaN \n", - " 3 NaN NaN NaN NaN NaN NaN NaN NaN NaN \n", - " 5 NaN NaN -10.4 NaN NaN NaN NaN NaN NaN \n", - "8 -2 NaN 135.0 136.0 NaN 138.0 NaN NaN NaN NaN \n", - "9 -1 NaN 128.5 130.0 NaN 131.0 NaN NaN NaN NaN \n", - "\n", - "coordination VI VII VIII X XI XII XIV \n", - "atomic_number charge \n", - "1 1 NaN NaN NaN NaN NaN NaN NaN \n", - "3 1 76.0 NaN 92.0 NaN NaN NaN NaN \n", - "4 2 45.0 NaN NaN NaN NaN NaN NaN \n", - "5 3 27.0 NaN NaN NaN NaN NaN NaN \n", - "6 4 16.0 NaN NaN NaN NaN NaN NaN \n", - "7 -3 NaN NaN NaN NaN NaN NaN NaN \n", - " 3 16.0 NaN NaN NaN NaN NaN NaN \n", - " 5 13.0 NaN NaN NaN NaN NaN NaN \n", - "8 -2 140.0 NaN 142.0 NaN NaN NaN NaN \n", - "9 -1 133.0 NaN NaN NaN NaN NaN NaN " - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "irs = fetch_ionic_radii(radius=\"ionic_radius\")\n", - "irs.head(10)" + "ox = fetch_table(\"oxidationstates\")\n", + "ox" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "## Ionization energies\n", + "## phasetransitions\n", "\n", - "To fetch ionization energies use `fetch_ionization_energies` that takes a `degree` (default is `degree=1`) argument that can either be a single integer or a list if integers to fetch multiple ionization energies." + "For most elements a single row is present with phase transition properies, however for elements with multiple allotropes (i.e. Carbon, Phosphorus, Selenium, Sulfur, Tin) values are provided for each allotrope." ] }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ - "from mendeleev.fetch import fetch_ionization_energies" + "pt = fetch_table(\"phasetransitions\")\n", + "pt.sort_values(by=\"atomic_number\").head(15)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## propertymetadata\n", + "\n", + "This table holds a lot of the metadata that is used to render the data documentation page. Probably the most useful piece of information here is the unit assocaited with a given property. The units are compatible with the [pint](https://pint.readthedocs.io/en/stable/) package so properties might be used direclty with units." ] }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
IE2
atomic_number
1NaN
254.417763
375.640094
418.211153
525.154830
624.384500
729.601250
835.121110
934.970810
1040.962960
\n", - "
" - ], - "text/plain": [ - " IE2\n", - "atomic_number \n", - "1 NaN\n", - "2 54.417763\n", - "3 75.640094\n", - "4 18.211153\n", - "5 25.154830\n", - "6 24.384500\n", - "7 29.601250\n", - "8 35.121110\n", - "9 34.970810\n", - "10 40.962960" - ] - }, - "execution_count": 25, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "ies = fetch_ionization_energies(degree=2)\n", - "ies.head(10)" + "metadata = fetch_table(\"propertymetadata\")\n", + "metadata.head(10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## scattering_factors" ] }, { "cell_type": "code", - "execution_count": 24, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
IE1IE3IE5
atomic_number
113.598434NaNNaN
224.587388NaNNaN
35.391715122.454354NaN
49.322699153.896198NaN
58.29801937.930580340.226008
611.26029647.887780392.090500
714.53413047.44530097.890130
813.61805454.935540113.898900
917.42282062.708000114.249000
1021.56454063.423310126.247000
\n", - "
" - ], - "text/plain": [ - " IE1 IE3 IE5\n", - "atomic_number \n", - "1 13.598434 NaN NaN\n", - "2 24.587388 NaN NaN\n", - "3 5.391715 122.454354 NaN\n", - "4 9.322699 153.896198 NaN\n", - "5 8.298019 37.930580 340.226008\n", - "6 11.260296 47.887780 392.090500\n", - "7 14.534130 47.445300 97.890130\n", - "8 13.618054 54.935540 113.898900\n", - "9 17.422820 62.708000 114.249000\n", - "10 21.564540 63.423310 126.247000" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ - "ies_multiple = fetch_ionization_energies(degree=[1, 3, 5])\n", - "ies_multiple.head(10)" + "scattering_factors = fetch_table(\"scattering_factors\")\n", + "scattering_factors.head(10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## screeningconstants" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "screening = fetch_table(\"screeningconstants\")\n", + "screening.head(10)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## series\n", + "\n", + "Metadata about periodic table series." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "series = fetch_table(\"series\")\n", + "series" ] }, { @@ -1473,7 +530,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1482,258 +539,37 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
AllenAllred-RochowCottrell-SuttonGhoshGordyLi-XueMartynov-BatsanovMullikenNaglePaulingSanderson
atomic_number
113.6100.0009770.1767770.2638000.031250{('I', ''): -3.540721753312244, ('II', ''): -2...3.6876056.7992170.6053882.202.187771
224.5900.0008030.1922410.4427120.036957{}6.28510712.2936941.130639NaN1.000000
35.3920.0000730.0988660.1050930.009774{('IV', ''): 1.7160634314550876, ('VI', ''): 1...2.3220072.6958570.1826500.980.048868
49.3230.0001870.1382670.1449860.019118{}3.7103814.6613500.3756151.570.126847
512.1300.0003600.1748950.1848860.030588{}4.8779584.1490100.5269742.040.254627
615.0500.0005780.2081670.2247760.043333{}6.0833005.6301480.7073932.550.427525
718.1300.0007740.2343710.2649300.054930{}7.3067687.2670650.8774983.040.577482
821.3600.0011460.2687420.3045750.072222{}8.4961366.8090271.0422183.440.941649
924.8000.0012700.2850440.3444430.081250{}9.7018088.7114101.2323733.981.017681
1028.3100.0013030.2954880.3843900.087313{}10.918389NaN1.443255NaN1.000000
\n", - "
" - ], - "text/plain": [ - " Allen Allred-Rochow Cottrell-Sutton Ghosh Gordy \\\n", - "atomic_number \n", - "1 13.610 0.000977 0.176777 0.263800 0.031250 \n", - "2 24.590 0.000803 0.192241 0.442712 0.036957 \n", - "3 5.392 0.000073 0.098866 0.105093 0.009774 \n", - "4 9.323 0.000187 0.138267 0.144986 0.019118 \n", - "5 12.130 0.000360 0.174895 0.184886 0.030588 \n", - "6 15.050 0.000578 0.208167 0.224776 0.043333 \n", - "7 18.130 0.000774 0.234371 0.264930 0.054930 \n", - "8 21.360 0.001146 0.268742 0.304575 0.072222 \n", - "9 24.800 0.001270 0.285044 0.344443 0.081250 \n", - "10 28.310 0.001303 0.295488 0.384390 0.087313 \n", - "\n", - " Li-Xue \\\n", - "atomic_number \n", - "1 {('I', ''): -3.540721753312244, ('II', ''): -2... \n", - "2 {} \n", - "3 {('IV', ''): 1.7160634314550876, ('VI', ''): 1... \n", - "4 {} \n", - "5 {} \n", - "6 {} \n", - "7 {} \n", - "8 {} \n", - "9 {} \n", - "10 {} \n", - "\n", - " Martynov-Batsanov Mulliken Nagle Pauling Sanderson \n", - "atomic_number \n", - "1 3.687605 6.799217 0.605388 2.20 2.187771 \n", - "2 6.285107 12.293694 1.130639 NaN 1.000000 \n", - "3 2.322007 2.695857 0.182650 0.98 0.048868 \n", - "4 3.710381 4.661350 0.375615 1.57 0.126847 \n", - "5 4.877958 4.149010 0.526974 2.04 0.254627 \n", - "6 6.083300 5.630148 0.707393 2.55 0.427525 \n", - "7 7.306768 7.267065 0.877498 3.04 0.577482 \n", - "8 8.496136 6.809027 1.042218 3.44 0.941649 \n", - "9 9.701808 8.711410 1.232373 3.98 1.017681 \n", - "10 10.918389 NaN 1.443255 NaN 1.000000 " - ] - }, - "execution_count": 27, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "ens = fetch_electronegativities()\n", "ens.head(10)" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Version information" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import mendeleev\n", + "\n", + "print(f\"{mendeleev.__version__=}\")" + ] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -1747,7 +583,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.1" + "version": "3.12.0" } }, "nbformat": 4, diff --git a/docs/source/notebooks/electronic_configuration.ipynb b/docs/source/notebooks/electronic_configuration.ipynb index 603eaf72..982999b7 100644 --- a/docs/source/notebooks/electronic_configuration.ipynb +++ b/docs/source/notebooks/electronic_configuration.ipynb @@ -302,7 +302,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -316,7 +316,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.1" + "version": "3.12.0" } }, "nbformat": 4, diff --git a/docs/source/notebooks/ions.ipynb b/docs/source/notebooks/ions.ipynb index e0d80f47..9f84c44b 100644 --- a/docs/source/notebooks/ions.ipynb +++ b/docs/source/notebooks/ions.ipynb @@ -146,7 +146,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -160,7 +160,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.1" + "version": "3.12.0" } }, "nbformat": 4, diff --git a/docs/source/notebooks/quick_start.ipynb b/docs/source/notebooks/quick_start.ipynb index e2555a3a..4be503f2 100644 --- a/docs/source/notebooks/quick_start.ipynb +++ b/docs/source/notebooks/quick_start.ipynb @@ -267,13 +267,6 @@ "* spin" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - }, { "cell_type": "code", "execution_count": null, @@ -551,35 +544,12 @@ "# calculate mulliken electronegativity for a neutral atom or ion\n", "si.electronegativity(scale=\"mulliken\", charge=1)" ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## CLI utility\n", - "\n", - "For those who work in the terminal there is a simple command line interface (CLI) for printing the information about a given element. The script name is element.py and it accepts either the symbol or name of the element as an argument and prints the data about it. For example, to print the properties of silicon type" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false, - "jupyter": { - "outputs_hidden": false - } - }, - "outputs": [], - "source": [ - "!element.py Si" - ] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -593,7 +563,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.9" + "version": "3.12.0" }, "toc-autonumbering": false, "toc-showcode": false, diff --git a/docs/source/notebooks/visualizations.ipynb b/docs/source/notebooks/visualizations.ipynb index 1ab95b0c..1967f80a 100644 --- a/docs/source/notebooks/visualizations.ipynb +++ b/docs/source/notebooks/visualizations.ipynb @@ -215,7 +215,7 @@ "metadata": { "anaconda-cloud": {}, "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -229,7 +229,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.12.0" } }, "nbformat": 4, diff --git a/mendeleev/fetch.py b/mendeleev/fetch.py index a7932907..fe3ad1a8 100644 --- a/mendeleev/fetch.py +++ b/mendeleev/fetch.py @@ -58,6 +58,7 @@ def fetch_table(table: str, **kwargs) -> pd.DataFrame: "oxidationstates", "phasetransitions", "propertymetadata", + "scattering_factors", "screeningconstants", "series", }