Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade pyFAI #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Example usage:

pg = pygix.Transform()
pg.load('detector_calibration.poni')
pg.indcident_angle = 0.2
pg.incident_angle = 0.2

# transform image into reciprocal space:
i, qxy, qz = pg.transform_reciprocal(data)
Expand Down
14 changes: 8 additions & 6 deletions bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
__authors__ = ["Frédéric-Emmanuel Picca", "Jérôme Kieffer"]
__contact__ = "jerome.kieffer@esrf.eu"
__license__ = "MIT"
__date__ = "15/09/2016"

__date__ = "25/05/2023"

import sys
import os
Expand All @@ -25,10 +24,11 @@ def _distutils_dir_name(dname="lib"):
"""
Returns the name of a distutils build directory
"""
platform = distutils.util.get_platform()
architecture = "%s.%s-%i.%i" % (dname, platform,
sys.version_info[0], sys.version_info[1])
return architecture
return dname
# platform = distutils.util.get_platform()
# architecture = "%s.%s-%i.%i" % (dname, platform,
# sys.version_info[0], sys.version_info[1])
# return architecture


def _distutils_scripts_name():
Expand All @@ -48,6 +48,7 @@ def _get_available_scripts(path):


if sys.version_info[0] >= 3: # Python3

def execfile(fullpath):
"Python3 implementation for execfile"
with open(fullpath) as f:
Expand All @@ -66,6 +67,7 @@ def runfile(fname):
run = subprocess.Popen(sys.argv, shell=False, env=env)
run.wait()


home = os.path.dirname(os.path.abspath(__file__))
SCRIPTSPATH = os.path.join(home, 'build', _distutils_scripts_name())
LIBPATH = os.path.join(home, 'build', _distutils_dir_name('lib'))
Expand Down
2 changes: 1 addition & 1 deletion pygix/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def make_header_string(self, header_dict=None, hdr_key='#',

hdr_list = []
for k, v in header_dict.items():
if (v.__class__ is str) and (len(v) is 0):
if v == "":
hdr_list.append(k)
else:
hdr_list.append('{}: {}'.format(k, v))
Expand Down
8 changes: 4 additions & 4 deletions pygix/plotting.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -43,7 +44,7 @@
r'\usepackage{helvet}',
r'\usepackage[EULERGREEK]{sansmath}',
r'\sansmath']
mpl.rcParams['text.latex.preamble'] = latexpre
mpl.rcParams['text.latex.preamble'] = os.linesep.join(latexpre)

DEFAULT_UNIT = 'nm^-1'
LABELS_DICT = {
Expand Down Expand Up @@ -89,7 +90,7 @@ def get_axis_label(label=None):
Returns:

"""
if (label is None) or (len(label) is 0):
if (label is None) or (len(label) == 0):
return ''
if '(' in label:
quantity, unit = label.split('(')
Expand Down Expand Up @@ -264,7 +265,6 @@ def plot(x, y,
if show:
plt.show()


# def rsmplot(data, x=None, y=None, xlim=None, ylim=None,
# xlabel=None, ylabel=None, cmap=None, colorbar=False, clim='auto',
# newfig=True, show=True, figsize=(7, 7), tight_layout=True,
Expand Down Expand Up @@ -386,7 +386,7 @@ def implot(data, x=None, y=None, mode=None,
cax = divider.append_axes("right", size="5%", pad=0.05)
plt.colorbar(im, cax=cax)

ax.set_axis_bgcolor(colormap(0))
ax.set_facecolor(colormap(0))

if tight_layout:
plt.tight_layout()
Expand Down
Loading