-
Notifications
You must be signed in to change notification settings - Fork 922
Fix unit for Element
properties: density_of_solid
and Molar volume
#4454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix unit for Element
properties: density_of_solid
and Molar volume
#4454
Conversation
1190a26
to
97bd8b2
Compare
Element
propertiesElement
properties: density_of_solid
and Molar volume
Np: 4273, Pu: 3503, Am: 2880, Cm: 3383} | ||
Brinell hardness: | ||
unit: MN m^-2 | ||
unit: MPa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be breaking.
These two units are exactly the same but feels like MPa
might be more common than MN m^-2
(also more consistent with docstring and other hardness)?
pymatgen/src/pymatgen/core/periodic_table.py
Lines 107 to 112 in f9d9fe8
bulk_modulus (float, optional): Bulk modulus (GPa). | |
youngs_modulus (float, optional): Young's modulus (GPa). | |
brinell_hardness (float, optional): Brinell hardness (MPa). | |
rigidity_modulus (float, optional): Rigidity modulus (GPa). | |
mineral_hardness (float, optional): Mohs hardness. | |
vickers_hardness (float, optional): Vickers hardness (MPa). |
mineral_hardness (float, optional): Mohs hardness. | ||
vickers_hardness (float, optional): Vickers hardness (MPa). | ||
density_of_solid (float, optional): Density in solid phase (g/cm³). | ||
density_of_solid (float, optional): Density in solid phase (kg/m³). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no strong opinion on this, I originally thought we just remove all units from the docstring if it's a scalar and redirect people to get the unit from FloatWithUnit
, but feels like it's not good for docstring clarity as most data for ptable wouldn't be updated very often, also many units are pretty much "singleton" (e.g. K for temperature, angstrom for radii,...):
pymatgen/src/pymatgen/core/periodic_table.py
Lines 84 to 116 in f9d9fe8
Attributes: | |
Z (int): Atomic number of the element. | |
symbol (str): Element symbol (e.g., "H", "Fe"). | |
long_name (str): Full name of the element (e.g., "Hydrogen"). | |
A (int, optional): Atomic mass number (sum of protons and neutrons). | |
atomic_radius_calculated (float, optional): Calculated atomic radius (Å). | |
van_der_waals_radius (float, optional): Van der Waals radius (Å). | |
mendeleev_no (int, optional): Mendeleev number based on crystal-structure maps. | |
electrical_resistivity (float, optional): Electrical resistivity (Ω·m). | |
velocity_of_sound (float, optional): Velocity of sound (m/s). | |
reflectivity (float, optional): Reflectivity (%). | |
refractive_index (float, optional): Refractive index. | |
poissons_ratio (float, optional): Poisson's ratio. | |
molar_volume (float, optional): Molar volume (cm³/mol). | |
electronic_structure (str): Electronic structure (e.g., "[Ar].3d6.4s2"). | |
atomic_orbitals (dict): Orbital energies (Hartree units). | |
atomic_orbitals_eV (dict): Orbital energies in electron volts (eV). | |
thermal_conductivity (float, optional): Thermal conductivity (W/m·K). | |
boiling_point (float, optional): Boiling point (K). | |
melting_point (float, optional): Melting point (K). | |
critical_temperature (float, optional): Critical temperature (K). | |
superconduction_temperature (float, optional): Superconducting transition temperature (K). | |
liquid_range (float, optional): Temperature range for liquid phase (K). | |
bulk_modulus (float, optional): Bulk modulus (GPa). | |
youngs_modulus (float, optional): Young's modulus (GPa). | |
brinell_hardness (float, optional): Brinell hardness (MPa). | |
rigidity_modulus (float, optional): Rigidity modulus (GPa). | |
mineral_hardness (float, optional): Mohs hardness. | |
vickers_hardness (float, optional): Vickers hardness (MPa). | |
density_of_solid (float, optional): Density in solid phase (g/cm³). | |
coefficient_of_linear_thermal_expansion (float, optional): Thermal expansion coefficient (K⁻¹). | |
ground_level (float, optional): Ground energy level of the element. | |
ionization_energies (list[Optional[float]]): Ionization energies (kJ/mol), indexed from 0. |
Summary
Element
properties, to close Units in docstring appear to be wrong for density_in_solid #4453