Commit 9eed0777 authored by Thomas Vincent's avatar Thomas Vincent

Merge branch 'fixes' into 'master'

Doc and build fixes

See merge request kmap/xsocs!113
parents 61912c7f c5ba1320
Pipeline #8194 passed with stages
in 8 minutes and 50 seconds
......@@ -29,14 +29,12 @@ variables: # Global variables
- python ./ci/info_platform.py
script:
- python setup.py bdist_wheel
- python setup.py build build_doc
- ls dist/
after_script:
- rm -rf ${VENV_DIR}
artifacts:
paths:
- dist/
- build/sphinx/html/
when: on_success
expire_in: 2h
......@@ -84,7 +82,7 @@ linux_test_python2:
# Python3 tasks
.linux_python3_variables:
variables: &linux_python3_definition
IMAGE: python:3.4-jessie
IMAGE: docker-registry.esrf.fr/dau/tomwer:python3.5_stretch_pyqt5
PYTHON: python3
linux_build_python3:
......@@ -103,9 +101,11 @@ linux_test_python3:
# Deploy documentation in gitlab (only for master branch)
pages:
stage: deploy
image: python:3.4-jessie
tags:
- linux
image: python:2.7-jessie
dependencies:
- linux_build_python3
- windows_build_python3
script:
- rm -rf public
- mv build/sphinx/html public
......@@ -139,10 +139,14 @@ windows_build_python3:
- python ci\info_platform.py
# Build the wheel
- python setup.py bdist_wheel
# Build the doc (dependencies are needed)
- pip install --upgrade -r requirements.txt
- python setup.py build build_doc
- dir dist
artifacts:
paths:
- dist
- build/sphinx/html/
when: on_success
expire_in: 2h
......
......@@ -9,3 +9,4 @@ When running through ssh, there are a few reasons that can avoid the display of
See `Using OpenGL through ssh <http://www.silx.org/doc/silx/latest/troubleshooting.html#using-opengl-through-ssh>`_ in `silx <http://www.silx.org/doc/silx/latest/>`_ documentation for more information.
You can disable the 3D view of the QSpace with the ``--no-3d`` option from the command line.
......@@ -75,3 +75,9 @@ Q space Parameters
* - ``Coordinates``
- Select the coordinate system of the QSpace histogram.
Either **Cartesian** or **Spherical**.
The conversion from **Cartesian** to **Spherical** coordinates is as follows:
* Radius: :math:`\sqrt(qx^2 + qy^2 + qz^2)`
* Roll (Phi) in degrees: :math:`degrees(\pi/2 - arctan2(qz, qy))`
* Pitch (Theta) in degrees: :math:`degrees(\pi/2 - arccos(qx/radius)`
......@@ -31,15 +31,15 @@ The next page gives you the choice between:
To load data that has already been merged, select the `master` file of the merged data (the file that contains links to all entries).
Once the project is created, the `Project summary`_ page is displayed.
#. **Import SPEC data** to import K-map data from SPEC and EDF files.
#. **Import SPEC data** to import K-map data SPEC and EDF files from the ESRF ID01 beamline.
X-SOCS will merge the SPEC file and the EDF images into HDF5 files.
See `Merge SPEC and EDF to HDF5`_ below.
See `Merge ID01 SPEC and EDF to HDF5`_ below.
Merge SPEC and EDF to HDF5
--------------------------
Merge ID01 SPEC and EDF to HDF5
--------------------------------
When using X-SOCS to merge data the following window is displayed:
......
......@@ -2,7 +2,6 @@
# Those ARE NOT required for installation or at runtime
numpy >= 1.8
silx >= 0.9.0 # To build script command doc
setuptools # Advanced packaging tools
wheel # To build wheels
Cython >= 0.21.1 # To regenerate .c/.cpp files from .pyx
......
......@@ -2,7 +2,7 @@
# coding: utf8
# /*##########################################################################
#
# Copyright (c) 2015-2018 European Synchrotron Radiation Facility
# Copyright (c) 2015-2019 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......@@ -106,6 +106,7 @@ classifiers = ["Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Cython",
"Programming Language :: Python :: 2.7",
......@@ -470,10 +471,15 @@ class BuildExt(build_ext):
# Convert flags from gcc to MSVC if required
if self.compiler.compiler_type == 'msvc':
ext.extra_compile_args = [self.COMPILE_ARGS_CONVERTER.get(f, f)
for f in ext.extra_compile_args]
ext.extra_link_args = [self.LINK_ARGS_CONVERTER.get(f, f)
for f in ext.extra_link_args]
extra_compile_args = [self.COMPILE_ARGS_CONVERTER.get(f, f)
for f in ext.extra_compile_args]
# Avoid empty arg
ext.extra_compile_args = [arg for arg in extra_compile_args if arg]
extra_link_args = [self.LINK_ARGS_CONVERTER.get(f, f)
for f in ext.extra_link_args]
# Avoid empty arg
ext.extra_link_args = [arg for arg in extra_link_args if arg]
elif self.compiler.compiler_type == 'unix':
# Avoids runtime symbol collision for manylinux1 platform
......@@ -481,8 +487,17 @@ class BuildExt(build_ext):
extern = 'extern "C" ' if ext.language == 'c++' else ''
return_type = 'void' if sys.version_info[0] <= 2 else 'PyObject*'
ext.extra_compile_args.append(
'''-fvisibility=hidden -D'PyMODINIT_FUNC=%s__attribute__((visibility("default"))) %s ' ''' % (extern, return_type))
ext.extra_compile_args.append('-fvisibility=hidden')
import numpy
numpy_version = [int(i) for i in numpy.version.short_version.split(".", 2)[:2]]
if numpy_version < [1,16]:
ext.extra_compile_args.append(
'''-D'PyMODINIT_FUNC=%s__attribute__((visibility("default"))) %s ' ''' % (extern, return_type))
else:
ext.define_macros.append(
('PyMODINIT_FUNC',
'%s__attribute__((visibility("default"))) %s ' % (extern, return_type)))
def is_debug_interpreter(self):
"""
......@@ -637,7 +652,8 @@ class SourceDistWithCython(sdist):
from Cython.Build import cythonize
cythonize(
self.extensions,
compiler_directives={'embedsignature': True},
compiler_directives={'embedsignature': True,
'language_level': 3},
force=True
)
......
......@@ -58,15 +58,12 @@ def merge_scan_data(output_dir,
with an (existing) image file. Existing output files will be
overwritten.
:param output_dir: folder name into which output data (as well as
temporary files) will be written.
:type output_dir: str
:param str output_dir: folder name into which output data
(as well as temporary files) will be written.
:param spec_fname: path to the spec file.
:type output_dir: str
:param str spec_fname: path to the spec file.
:param beam_energy: beam energy in ....
:type beam_energy: numeric
:param float beam_energy: beam energy in ....
:param chan_per_deg: 2 elements array containing the number of channels
per degree (v, h) (as defined by xrayutilitied, used when converting to
......@@ -77,15 +74,10 @@ def merge_scan_data(output_dir,
the direct beam position in the detector coordinates.
:type center_chan: *optional* array_like
:param scan_ids: array of scan numbers to add to the merged file. If
None, all valid scans will be merged.
:param scan_ids: array of scan numbers to add to the merged file.
If None, all valid scans will be merged.
:type scan_ids: *optional* array of int
:param master_f: name of the "master" (top level) HDF5 file.
If None, the file will be named master.h5. This file is created in the
folder pointed to by output_dir.
:type master_f: *optional* str
:param str img_dir: directory path. If provided the image files will be
looked for into that folder instead of the one found in the scan
headers.
......@@ -95,31 +87,28 @@ def merge_scan_data(output_dir,
If None, the number of processes used will be the
default config value (usually the number of cores).
:param version: version of the spec file. It is currently used to get
the offset and padding to apply to the nextNr value found in the spec scan
headers. This nextNr is then used to generate the image file name. Set it
to 0 if you are merging data generated before April 2016 (TBC).
:type img_dir: *optional* int
:param nr_padding: zero padding to apply to the nextNr number found
in the SPEC file.
:type nr_padding: int
:param int version: version of the spec file.
It is currently used to get the offset and padding to apply to
the nextNr value found in the spec scan headers.
This nextNr is then used to generate the image file name.
Set it to 0 if you are merging data generated before April 2016 (TBC).
:param nr_offset: offset to apply to the nextNr number found
:param int nr_padding: zero padding to apply to the nextNr number found
in the SPEC file.
:type nr_offset: int
:param int nr_offset:
Offset to apply to the nextNr number found in the SPEC file.
:param Union[str,int] compression: The HDF5 compression to use.
:param bool overwrite: True to allow overwriting already existing output file
:param image_roi:
:param Union[List[int],None] image_roi:
Detector image ROI (origin_row, origin_column, height, width) to save,
or None (default) to save the whole image
:type image_roi: Union[List[int],None]
:returns: a list of scan IDs that were merged
:rtype: *list*
:rtype: List
"""
base_spec = os.path.basename(spec_fname)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment