Giter Site home page Giter Site logo

fgjorup / reel Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 2.0 34.5 MB

Reel1.0 is a visualization tool for powder diffraction data and refinement results, intended for in-situ, operando, or similar larges datasets.

License: MIT License

Python 99.41% Batchfile 0.21% TeX 0.38%
pxrd rietveld-refinement parametric-refinement diffraction python

reel's Introduction

Frederik H. Gjørup, MSc

PhD student at Department of Chemistry & iNANO, Aarhus University, Denmark
E-mail: [email protected]
ORCID ID: https://orcid.org/0000-0003-3902-0247

I am primarily working the data visualization and analysis, with particular focus on powder diffraction.

reel's People

Contributors

fgjorup avatar moerch avatar

Stargazers

 avatar

Watchers

 avatar  avatar

reel's Issues

Sort files for Mac functionality

When opening multiple sequentially listed files in debug mode (for ex. the .xyy test files), the generated 2D plots are have unusual striations and the files are loaded non-sequentially. Probably needs a sort function in the openTestfiles method:

def openTestfiles(self):  
        path = os.path.abspath('_test_files')
        test_sets = os.listdir(path)
        for tset in test_sets:
            ts_path = os.path.join(path,tset)
            files = [os.path.join(ts_path,f) for f in os.listdir(ts_path) if f.endswith(tset)]
            ext = '*.'+files[0].split('.')[-1]
            self.addDataset(self,files=files,ext=ext)

Uses windows-specific file paths

Hi,

I'm trying to run Reel under linux using the MacOS instructions, but it fails due to windows-style path names:

Traceback (most recent call last):
  File "/home/pflueger/work/Reel/Reel1.0/Refinement_evaluator_ver1.0.py", line 1117, in <module>
    main()
  File "/home/pflueger/work/Reel/Reel1.0/Refinement_evaluator_ver1.0.py", line 1112, in main
    ui = mainWindow()
  File "/home/pflueger/work/Reel/Reel1.0/Refinement_evaluator_ver1.0.py", line 76, in __init__
    self.miw = MultiImageWidget(n_images=3,labels=('Observed','Calculated','Scale','Residual','Scale'))
  File "/home/pflueger/work/Reel/Reel1.0/_lib/ReelPlotWidgets.py", line 71, in __init__
    im = np.fromfile('_lib\icons\Main.raw', dtype='ubyte').reshape(230,230).astype(float)
FileNotFoundError: [Errno 2] No such file or directory: '_lib\\icons\\Main.raw'

You can make your program more portable by using https://docs.python.org/3/library/pathlib.html instead of explicit paths. Maybe you could make your program even more portable by using https://docs.python.org/3/library/importlib.html#module-importlib.resources .

Cheers,

Mika

LICENSE and README.md contradict each other

Hi,

according to the LICENSE file, Reel is published under the MIT license; however, the README.md file states:

The software provided here is intended only for internal use at Department of Chemistry, Aarhus University, and should not be distributed outside of the institute without the consent of the author.

Which clearly poses additional restrictions not imposed by the MIT license. I guess it is just a leftover from earlier? Preferably, you would just point to the license file with a statement such as "Reel is published under the MIT licence, details can be found in the LICENSE file." or similar.

Cheers,

Mika

Cannot open new file from GUI

Running on a Mac, I cannot open a new file from the GUI. I see:

  File "Refinement_evaluator_ver1.0.py", line 740, in openFiles
    path = os.environ['USERPROFILE']
  File "/Users/cmbiwer/anaconda3/envs/reel/lib/python3.8/os.py", line 675, in __getitem__
    raise KeyError(key) from None
KeyError: 'USERPROFILE'

It is looking for USERPROFILE in my environment but I didn't notice anything about this in the documentation.

Reading files from folders with many files(>1000) is slow

When loading files from a folder with many files (>1000) windows explorer is a bottleneck slowing the process down.

My suggestion is to add the following to read files from a given directory, with a common string.

Add the following line to ReelUserSettings:
UseCommonFiles = False

Add the following to Refinement_evaluator_ver1.0.py

def commonFiles(self,src):
    src = QtWidgets.QFileDialog.getExistingDirectory(self, 'Select path', src)
    string, _ = QtWidgets.QInputDialog.getText(self,"Common string","Common string file ends with")
    print(string)
    files = os.listdir(src)
    files.sort()
    print(files[0])

    files = [ os.path.join(src,x) for x in files if x.endswith(f"{string}")]
    print(len(files))
    _ , ext = os.path.splitext(string)
    print(files[0])
    print("*"+ext)
    return files,"*"+ext

Change

        filters = ext+';;'+';;'.join([x for x in filters.replace(ext,'').split(';;') if x])
        files, ext =  QtWidgets.QFileDialog.getOpenFileNames(self, 'Select files', path , filters)
    if len(files)<1:

to

        filters = ext+';;'+';;'.join([x for x in filters.replace(ext,'').split(';;') if x])
        if us.UseCommonFiles:
            files, ext = self.commonFiles(path) 
        else:
            files, ext =  QtWidgets.QFileDialog.getOpenFileNames(self, 'Select files', path , filters)
    if len(files)<1:

Runtime error with PyQt5 5.15.6

When updating PyQt5 to the newest version, the following RuntimeError is presented when trying to open Reel.

Opening Reel 1.0...
Traceback (most recent call last):
File "Refinement_evaluator_ver1.0.py", line 19, in
from PyQt5 import QtCore, QtWidgets, uic, QtGui
RuntimeError: the sip module implements API v12.0 to v12.8 but the PyQt5.QtCore module requires API v12.9
Press any key to continue . . .

Downgrading to 5.14.2 solves the issue

Markdown table not formatted correctly

You're table in README.md does not render correctly. It should be

| Module | Version | pip install command |
| ------ | ------- | ------------------- |
| PyQt5 | v. 5.14.2 | pip install PyQt5 |
| pyqtgraph | v. 0.11.1 | pip install pyqtgraph |
| matplotlib | v. 3.3.3 | pip install matplotlib |
| numpy | v. 1.19.5 | pip install numpy |
| scipy | v. 1.6.0 | pip install scipy |

To get

Module Version pip install command
PyQt5 v. 5.14.2 pip install PyQt5
pyqtgraph v. 0.11.1 pip install pyqtgraph
matplotlib v. 3.3.3 pip install matplotlib
numpy v. 1.19.5 pip install numpy
scipy v. 1.6.0 pip install scipy

please add community guidelines

Hi,

for JOSS acceptance, Reel needs "clear guidelines for third parties wishing to 1) Contribute to the software 2) Report issues or problems with the software 3) Seek support". So, please state if and how you accept third-party contributions / patches, briefly describe how to report issues and if there are channels to seek support when using Reel.

Cheers,

Mika

AttributeError: module 'PyQt5.QtCore' has no attribute 'Signal'

Hi,

after installing Reel (regardless if under windows or linux), in python 3.8 with the latest dependencies as stated in requirements.txt, I get the following error when starting Reel:

Opening Reel 1.0...
Traceback (most recent call last):
  File "Refinement_evaluator_ver1.0.py", line 28, in <module>
    from _lib.ReelPlotWidgets import MultiImageWidget, PlotPatternWidget, PlotSliceWidget, PlotParametersWidget
  File "C:\Users\Hein Mück\PycharmProjects\Reel\Reel1.0\_lib\ReelPlotWidgets.py", line 30, in <module>
    class MultiImageWidget(pg.GraphicsLayoutWidget):
  File "C:\Users\Hein Mück\PycharmProjects\Reel\Reel1.0\_lib\ReelPlotWidgets.py", line 32, in MultiImageWidget
    sigHLineDragged = QtCore.Signal(object)
AttributeError: module 'PyQt5.QtCore' has no attribute 'Signal'
Drücken Sie eine beliebige Taste . . .

It seems I can solve this by mokey-patching PyQt5.QtCore at line 24 of ReelPlotWidgets.py, but that is a very strange and hackish solution:

+ QtCore.Signal = QtCore.pyqtSignal

The versions of libraries installed in my python are:

Package Version
Pillow 8.3.2
PyQt5 5.15.4
PyQt5-Qt5 5.15.2
PyQt5-sip 12.9.0
cycler 0.10.0
kiwisolver 1.3.2
matplotlib 3.4.3
numpy 1.21.2
pip 21.1.2
pyparsing 2.4.7
pyqtgraph 0.12.2
python-dateutil 2.8.2
scipy 1.7.1
setuptools 57.0.0
six 1.16.0
wheel 0.36.2

I used virtualenv to create the python environment.

Cheers,

Mika

installation fails under windows for users with a space in their usernames

Hi,

I tried installing Reel under windows as per the instructions. Running the setup script seems to work, but starting Reel doesn't work, and the error message indicates that the problem is a space in the program's path, which happens because my username has a space in it. Probably something needs more quoting? Sorry, I have no clue about windows so can't diagnose the problem further.

Cheers,

Mika

Provide source code of the documentation

Hi,

the source code of Reel1.0 Quick Guide.pdf doesn't seem to be included in the repository. According to the metadata, the pdf seems to be produced originally using word, could you also include the word document in the repository?

Cheers,

Mika

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.