srmnitc / pasta-eln

PASTA-ELN with new frontend

Home Page:https://pasta-eln.github.io/pasta-eln/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PyPI version GitHub version PyPi build Verify Linux install Documentation building Linting MyPy

PASTA-ELN | The favorite ELN for experimental scientists

⚠️ Users: all documentation can be found at Github-pages

This page / area is for developers and contains some helpful information for them


Developers: notes on windows installation

How to start Pasta ELN

  • Anaconda
    • python -m pasta_eln.gui
    • DOES NOT WORK "pastaELN"

Installation location windows:

  • Default installation
    • C:\Users...\AppData\Local\Programs\Python\Python311\Scripts
    • C:\Users...\AppData\Local\Programs\Python\Python311\Lib\site-packages\pasta_eln
  • Anaconda
    • C:\Users...\anaconda3\envs...\Scripts>
    • C:\Users...\anaconda3\envs...\Lib\site-packages\pasta_eln

Reinstall /retry windows installation

  • uninstall couchdb in Settings
  • remove directories
    • C:\Program Files\Apache CouchDB
    • C:\Users....\AppData\Local\Programs\Python [If deleted python]
    • Pasta-Folder in Documents
  • remove Users....pastaELN.json
  • remove shortcut on Windows desktop
  • restart Windows
  • python -m pasta_eln.gui
  • go through steps and wait for restart
  • after restart go to System->Configuration (ctrl-0) ->Setup-> start again
    • or have a separate button for that

Developers: notes on linux installation

Installation location:

  • Default
    • /usr/local/lib/python3.10/dist-packages/pasta_eln

Restart installation on linux / ubuntu

rm .pastaELN.json pastaELN.log
rm -rf pastaELN/PastasExampleProject pastaELN/StandardOperatingProcedures
sudo snap stop couchdb
sudo snap remove couchdb

Test couchDB running

Notes on all systems

Run Pasta-ELN directly from commandline without installation

  • python3 -m pasta_eln.gui
  • python3 -m pasta_eln.installationTools
  • python3 -m pasta_eln.Tests.3Projects
  • pastaELN.py in home directory of repository

How to write code

How to write small python programs that do things

Backend

from pasta_eln.backend import Pasta
pasta = Pasta()
viewProj = pasta.db.getView('viewDocType/x0')
projID1  = [i['id'] for i in viewProj if 'PASTA' in i['value'][0]][0]
pasta.changeHierarchy(projID1)
print(pasta.outputHierarchy())

Frontend

For testing WIDGETS put this code into "pasta_eln/test.py":

from PySide6.QtWidgets import QApplication, QMainWindow
from .backend import Backend
from .communicate import Communicate
from .widgetDetails import Details

class MainWindow(QMainWindow):
  def __init__(self):
    super().__init__()
    self.backend = Backend()
    comm = Communicate(self.backend)
    widget = Details(comm)
    self.setCentralWidget(widget)
    comm.changeDetails.emit('m-a23019163b9c4fccb4edaab0feb2b5ee')

app = QApplication()
window = MainWindow()
window.show()
app.exec()

and execute "python -m pasta_eln.test"

For testing DIALOGS put this code into "pasta_eln/test.py":

import sys
from PySide6.QtWidgets import QApplication
from .GUI.form import Form
from .backend import Backend
from .guiCommunicate import Communicate

app = QApplication(sys.argv)
backend = Backend()
comm = Communicate(backend)
doc = backend.db.getDoc("m-3a43570c4fd84b1ab81a8863ae058fb0")
dialog = Form(comm, doc)
dialog.show()
sys.exit(app.exec())

and execute "python -m pasta_eln.test"

General notes

  • Find qt-awesome icons: qta-browser
  • print works great in frondend and backend

About

PASTA-ELN with new frontend

https://pasta-eln.github.io/pasta-eln/

License:Other


Languages

Language:Python 100.0%Language:Shell 0.0%