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 11
11
from itertools import product
12
12
13
13
import requests
14
- from bs4 import BeautifulSoup
14
+ from monty . dev import requires
15
15
from monty .serialization import dumpfn , loadfn
16
16
from ruamel import yaml
17
17
18
18
from pymatgen .core import Element , get_el_sp
19
19
20
+ try :
21
+ from bs4 import BeautifulSoup
22
+ except ImportError :
23
+ BeautifulSoup = None
24
+
20
25
ptable_yaml_path = "periodic_table.yaml"
21
26
22
27
@@ -231,6 +236,7 @@ def gen_iupac_ordering():
231
236
periodic_table [el ]["IUPAC ordering" ] = iupac_ordering_dict [get_el_sp (el )]
232
237
233
238
239
+ @requires (BeautifulSoup , "BeautifulSoup must be installed to use this method." )
234
240
def add_electron_affinities ():
235
241
"""Update the periodic table data file with electron affinities."""
236
242
Original file line number Diff line number Diff line change 5
5
import re
6
6
7
7
import 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
9
14
10
15
11
16
class VaspDoc :
12
17
"""A VASP documentation helper."""
13
18
19
+ @requires (BeautifulSoup , "BeautifulSoup must be installed to fetch from the VASP wiki." )
14
20
def __init__ (self ) -> None :
15
21
"""Init for VaspDoc."""
16
22
self .url_template = "http://www.vasp.at/wiki/index.php/%s"
Original file line number Diff line number Diff line change 1
1
ase>=3.22.1
2
+ beautifulsoup4==4.12.2
2
3
BoltzTraP2>=22.3.2
3
4
chemview>=0.6
4
5
f90nml>=1.4.3
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ spglib==2.1.0
11
11
pandas == 2.1.1
12
12
networkx == 3.1
13
13
plotly == 5.17.0
14
- beautifulsoup4 == 4.12.2
15
14
uncertainties == 3.1.7
16
15
Cython == 3.0.2
17
16
pybtex == 0.24.0
You can’t perform that action at this time.
0 commit comments