Commit afc177c9 authored by payno's avatar payno
Browse files

[Orange] mock up of the interface

parent 427002d6
Installation
------------
To install the add-on, run
pip install -r requirements.txt
To register this add-on with Orange, but keep the code in the development directory (do not copy it to
Python's site-packages directory), run
pip install -e .
Documentation / widget help can be built by running
make html htmlhelp
from the doc directory.
Add-on
------
After the installation, the add-on is registered with Orange. To run Orange from the terminal,
use
python -m Orange.canvas
The new widget appears in the toolbox bar under the section Example.
![screenshot](https://gitlab.esrf.fr/workflow/xas/tree/master/orangecontrib/xas/screenshots/screenshot.png)
Application
-----------
__import__("pkg_resources").declare_namespace(__name__)
# orangecontrib is a namespace modules shared by multiple Orange add-on so it
# needs to declare namespace.
# coding: utf-8
###########################################################################
# Copyright (C) 2016 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
#############################################################################
import sysconfig
# Category metadata.
# Category icon show in the menu
ICON = "icons/pymca.png"
# Background color for category background in menu
# and widget icon background in workflow.
BACKGROUND = "light-green"
URL = 'https://gitlab.esrf.fr/workflow/xas'
# Location of widget help files.
intersphinx = (
# Development documentation
# You need to build help pages manually using
# make htmlhelp
# inside doc folder
("{DEVELOP_ROOT}/doc/build/htmlhelp/index.html", None),
("{URL}/docs/latest/",
"{URL}/docs/latest/_objects/")
)
import unittest
def suite():
test_suite = unittest.TestSuite()
from .test import suite as widgets_suite
test_suite.addTest(widgets_suite())
return test_suite
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2016-2017 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# ###########################################################################*/
__authors__ = ["H. Payno"]
__license__ = "MIT"
__date__ = "06/07/2019"
from Orange.widgets import gui
from Orange.widgets.widget import OWWidget
from silx.gui import qt
from Orange.canvas.registry.description import OutputSignal, InputSignal
import numpy
import logging
_logger = logging.getLogger(__file__)
class ExafsOW(OWWidget):
"""
Widget used for signal extraction
"""
name = "exafs"
id = "orange.widgets.xas.exafs"
description = "Process signal extraction"
icon = "icons/exafs.png"
priority = 4
category = "esrfWidgets"
keywords = ["spectroscopy", "signal"]
want_main_area = True
resizing_enabled = True
inputs = [("spectrum", numpy.ndarray, "process")]
outputs = [("spectrum", numpy.ndarray)]
def __init__(self):
super().__init__()
def process(self, spectrum):
print('process', self.name)
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2016-2017 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# ###########################################################################*/
__authors__ = ["H. Payno"]
__license__ = "MIT"
__date__ = "06/07/2019"
from Orange.widgets import gui
from Orange.widgets.widget import OWWidget
from silx.gui import qt
from Orange.canvas.registry.description import OutputSignal, InputSignal
import numpy
import logging
_logger = logging.getLogger(__file__)
class FTOW(OWWidget):
"""
Widget used for signal extraction
"""
name = "fourier transform"
id = "orange.widgets.xas.ft"
description = "Process fourier transform"
icon = "icons/ft.png"
priority = 3
category = "esrfWidgets"
keywords = ["spectroscopy", "signal", "fourier", "transform", "fourier transform"]
want_main_area = True
resizing_enabled = True
inputs = [("spectrum", numpy.ndarray, "process")]
outputs = [("spectrum", numpy.ndarray)]
def __init__(self):
super().__init__()
def process(self, spectrum):
print('process', self.name)
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2016-2017 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# ###########################################################################*/
__authors__ = ["H. Payno"]
__license__ = "MIT"
__date__ = "06/07/2019"
from Orange.widgets import gui
from Orange.widgets.widget import OWWidget
from silx.gui import qt
from Orange.canvas.registry.description import OutputSignal, InputSignal
import numpy
import logging
_logger = logging.getLogger(__file__)
class KWeightOW(OWWidget):
"""
Widget used for signal extraction
"""
name = "k weight"
id = "orange.widgets.xas.k_weight"
description = "Process k weight"
icon = "icons/k_weight.png"
priority = 4
category = "esrfWidgets"
keywords = ["spectroscopy", "signal", "k", "weight"]
want_main_area = True
resizing_enabled = True
inputs = [("spectrum", numpy.ndarray, "process")]
outputs = [("spectrum", numpy.ndarray)]
def __init__(self):
super().__init__()
def process(self, spectrum):
print('process', self.name)
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2016-2017 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# ###########################################################################*/
__authors__ = ["H. Payno"]
__license__ = "MIT"
__date__ = "06/07/2019"
from Orange.widgets import gui
from Orange.widgets.widget import OWWidget
from silx.gui import qt
from Orange.canvas.registry.description import OutputSignal, InputSignal
import numpy
import logging
_logger = logging.getLogger(__file__)
class NormalizationOW(OWWidget):
"""
Widget used for signal extraction
"""
name = "normalization"
id = "orange.widgets.xas.normalization"
description = "Process spectrum normalization"
icon = "icons/normalization.png"
priority = 4
category = "esrfWidgets"
keywords = ["spectroscopy", "normalization"]
want_main_area = True
resizing_enabled = True
inputs = [("spectrum", numpy.ndarray, "process")]
outputs = [("spectrum", numpy.ndarray)]
def __init__(self):
super().__init__()
def process(self, spectrum):
print('process', self.name)
Supports Markdown
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