Skip to content

Commit

Permalink
Merge pull request #157 from prjemian/LGTM-156
Browse files Browse the repository at this point in the history
resolve LGTM alerts
  • Loading branch information
prjemian committed Jun 14, 2019
2 parents 182cb18 + 91fe38b commit e63ecdc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/spec2nexus/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def get_versions():
# versionfile_source is the relative path from the top of the source
# tree (where the .git directory might live) to this file. Invert
# this to find the root from __file__.
for _i in cfg.versionfile_source.split('/'):
for _i in cfg.versionfile_source.split('/'): # lgtm [py/unused-loop-variable]
root = os.path.dirname(root)
except NameError:
return {"version": "0+unknown", "full-revisionid": None,
Expand Down
7 changes: 4 additions & 3 deletions src/spec2nexus/uxml/uxml_spec2nexus.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ def writer(self, h5parent, writer, scan, *args, **kws):
#eznx.write_dataset(h5parent, "counting_basis", desc)
#eznx.write_dataset(h5parent, "T", float(scan.T), units='s', description = desc)
# TODO: parse the XML and store
selector = dict(dataset=Dataset, group=Group, hardlink=Hardlink)
for item in scan.UXML_root:
_obj = selector[item.tag](item)
# selector = dict(dataset=Dataset, group=Group, hardlink=Hardlink)
# for item in scan.UXML_root:
# _obj = selector[item.tag](item)
#print item.tag, item.get('name'), _obj, obj.name
raise NotImplementedError("uxml writer() not yet implemented")
19 changes: 10 additions & 9 deletions src/spec2nexus/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import numpy as np

import spec2nexus.eznx as eznx
import spec2nexus
import spec2nexus.spec as spec
import spec2nexus.utils as utils

Expand Down Expand Up @@ -167,15 +166,17 @@ def save_data(self, nxdata, scan):
signal, axes = self.mesh(nxdata, scan)
elif scan_type in ('hscan', 'kscan', 'lscan', 'hklscan'):
# hklscan 1.00133 1.00133 1.00133 1.00133 2.85 3.05 200 -400000
h_0, h_N, k_0, k_N, l_0, l_N = scan.scanCmd.split()[1:7]
# FIXME:
# h_0, h_N, k_0, k_N, l_0, l_N = scan.scanCmd.split()[1:7]
# TODO: why bother defining axes here? Not used. issue #155
if h_0 != h_N:
axes = ['H',]
elif k_0 != k_N:
axes = ['K',]
elif l_0 != l_N:
axes = ['L',]
signal, axes = self.oneD(nxdata, scan)
# if h_0 != h_N:
# axes = ['H',]
# elif k_0 != k_N:
# axes = ['K',]
# elif l_0 != l_N:
# axes = ['L',]
# FIXME: signal, axes = self.oneD(nxdata, scan)
raise NotImplementedError("hklscan save_data() not yet implemented")
else:
signal, axes = self.oneD(nxdata, scan)

Expand Down
4 changes: 2 additions & 2 deletions versioneer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1545,7 +1545,7 @@ def run(self):
from distutils.command.build_py import build_py as _build_py

class cmd_build_py(_build_py):
def run(self):
def run(self): # lgtm [py/similar-function]
root = get_root()
cfg = get_config_from_root(root)
versions = get_versions()
Expand All @@ -1569,7 +1569,7 @@ def run(self):
# ...

class cmd_build_exe(_build_exe):
def run(self):
def run(self): # lgtm [py/similar-function]
root = get_root()
cfg = get_config_from_root(root)
versions = get_versions()
Expand Down

0 comments on commit e63ecdc

Please sign in to comment.