Skip to content

Commit

Permalink
Use pathlib to get suffix
Browse files Browse the repository at this point in the history
The logic was searching for the first dot. This does work if the
path has a dot in it for example a version number in the package.
  • Loading branch information
cjh1 committed Sep 29, 2020
1 parent 48a44a2 commit 2b8ba2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hexrd/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import copy

from os import path
from pathlib import Path
from CifFile import ReadCif
import h5py
from warnings import warn
Expand Down Expand Up @@ -142,8 +143,7 @@ def __init__(self, name=None, material_file=None, dmin=DFLT_DMIN, kev=DFLT_KEV,
# >> @ date 08/20/2020 SS removing dependence on hklmax
#self._hklMax = Material.DFLT_SSMAX
# self._beamEnergy = Material.DFLT_KEV
n = material_file.find('.')
form = material_file[n+1:]
form = Path(material_file).suffix[1:]

if(form == 'cif'):
self._readCif(material_file)
Expand Down

0 comments on commit 2b8ba2e

Please sign in to comment.