lmmentel / mendeleev

A python package for accessing various properties of elements, ions and isotopes in the periodic table of elements.
https://mendeleev.readthedocs.io
MIT License
220 stars 40 forks source link

Fix ImportErrors not being raised #150

Closed lmmentel closed 4 months ago

lmmentel commented 4 months ago

fixes #149

This should ideally work for the following cases:

  1. :heavy_check_mark: lazy import of elements by symbol
from mendeleev import C
  1. :heavy_check_mark: import any existing module directly from mendeleev
from mendeleev import fetch
  1. :heavy_check_mark: raise an exception for non-existing objects
from mendeleev import whatever
ImportError: cannot import name 'whatever' from 'mendeleev' ...
kalvdans commented 4 months ago

Tests looks good. Also test from mendeleev import C please!