File tree Expand file tree Collapse file tree 4 files changed +15
-3
lines changed Expand file tree Collapse file tree 4 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 1111from itertools import product
1212
1313import requests
14- from bs4 import BeautifulSoup
14+ from monty . dev import requires
1515from monty .serialization import dumpfn , loadfn
1616from ruamel import yaml
1717
1818from pymatgen .core import Element , get_el_sp
1919
20+ try :
21+ from bs4 import BeautifulSoup
22+ except ImportError :
23+ BeautifulSoup = None
24+
2025ptable_yaml_path = "periodic_table.yaml"
2126
2227
@@ -231,6 +236,7 @@ def gen_iupac_ordering():
231236 periodic_table [el ]["IUPAC ordering" ] = iupac_ordering_dict [get_el_sp (el )]
232237
233238
239+ @requires (BeautifulSoup , "BeautifulSoup must be installed to use this method." )
234240def add_electron_affinities ():
235241 """Update the periodic table data file with electron affinities."""
236242
Original file line number Diff line number Diff line change 55import re
66
77import requests
8- from bs4 import BeautifulSoup
8+ from monty .dev import requires
9+
10+ try :
11+ from bs4 import BeautifulSoup
12+ except ImportError :
13+ BeautifulSoup = None
914
1015
1116class VaspDoc :
1217 """A VASP documentation helper."""
1318
19+ @requires (BeautifulSoup , "BeautifulSoup must be installed to fetch from the VASP wiki." )
1420 def __init__ (self ) -> None :
1521 """Init for VaspDoc."""
1622 self .url_template = "http://www.vasp.at/wiki/index.php/%s"
Original file line number Diff line number Diff line change 11ase>=3.22.1
2+ beautifulsoup4==4.12.2
23BoltzTraP2>=22.3.2
34chemview>=0.6
45f90nml>=1.4.3
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ spglib==2.1.0
1111pandas == 2.1.1
1212networkx == 3.1
1313plotly == 5.17.0
14- beautifulsoup4 == 4.12.2
1514uncertainties == 3.1.7
1615Cython == 3.0.2
1716pybtex == 0.24.0
You can’t perform that action at this time.
0 commit comments