diff --git a/README b/README index 6545880..b802851 100644 --- a/README +++ b/README @@ -1,39 +1,17 @@ Installing into private directory ================================= -For whatever reason, it might be useful to install the -python frontend into a private directory. -Here are some examples on how to do it: +1. Create a venv and include the system-site packages: + `python3 -m venv venv --system-site-packages` +2. Active that venv: `. venv/bin/activate` +3. Install an editable package: `pip install --no-deps -e .` - python setup.py install --home=/opt/damaris-private -or - python setup.py install --home=$HOME/devel/damaris-installed +This will use the system packages already installed. -To start Damaris use for example: +Alternatively you can install withoout the system-site-packages: - /opt/damaris-private/bin/DAMARIS + python3 -m venv venv + . venv/bin/activate + pip install -e . - -Updating debian/changelog -========================= - -Subversion -========== - -Use the following command to get all the commit messages: - -Mac OS X: - -svn2cl -i -a --stdout |gsed 's/^\t/ /'|gsed -e '/^[0-9]/d' - -Linux: - -svn2cl -i -a --stdout |sed 's/^\t/ /'|sed -e '/^[0-9]/d' - -Git -=== -git log --oneline . - - -Then pick the stuff the users need to know. -dch -M -v x.xx +This will download newer packages and install them in the venv. diff --git a/requirements.debian b/requirements.debian index 3d1e50f..e8ba18b 100644 --- a/requirements.debian +++ b/requirements.debian @@ -1,3 +1,18 @@ +#!/bin/bash sudo apt install libcairo2-dev -sudo apt install libgirepository-2.0-dev gir1.2-gtksource-3.0 - +sudo apt install python3-scipy python3-lmfit python3-matplotlib +sudo apt install gir1.2-gtksource-3.0 +DEBRELEASE=$(lsb_release -cs) +case $DEBRELEASE in + "trixie") + echo "Trixie detected" + sudo apt install libgirepository-2.0-dev + ;; + "bookworm") + echo "Bookworm detected" + sudo apt install libgirepository1.0-dev + ;; + *) + echo "not implemented" ; exit 1 + ;; +esac diff --git a/src/tests/debugging-gtk.sh b/src/tests/debugging-gtk.sh new file mode 100644 index 0000000..2c069a5 --- /dev/null +++ b/src/tests/debugging-gtk.sh @@ -0,0 +1,12 @@ +# 1. disable any possible re-launch +GIO_USE_VFS=local # stop gvfs daemonising +GSETTINGS_BACKEND=memory # don’t spawn dconf-service + +# 2. ask glib to abort on the first warning so nothing can “eat” it +G_DEBUG=fatal-warnings # or =fatal-criticals + +# 3. turn on *all* debug domains +G_MESSAGES_DEBUG=all + +# 4. run inside gdb so we can see the exact line that fails +gdb -ex run --args python3 src/gui/DamarisGUI.py diff --git a/src/tests/gtk3test.py b/src/tests/gtk3test.py new file mode 100644 index 0000000..7f2ebd5 --- /dev/null +++ b/src/tests/gtk3test.py @@ -0,0 +1,8 @@ +import gi +gi.require_version('Gtk', '3.0') +from gi.repository import Gtk +print("GTK imported successfully") +win = Gtk.Window() +win.connect("destroy", Gtk.main_quit) +win.show_all() +Gtk.main() diff --git a/src/tests/mpltest.py b/src/tests/mpltest.py new file mode 100644 index 0000000..098c8c8 --- /dev/null +++ b/src/tests/mpltest.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 +import os +import sys + +# 1) force GTK3 backend *before* pyplot is imported +os.environ['MPLBACKEND'] = 'GTK3Agg' # or GTK3Cairo + +# 2) turn on every debug message GLib/GTK will give us +os.environ['G_MESSAGES_DEBUG'] = 'all' +os.environ['GTK_DEBUG'] = 'interactive' # also enables Ctrl-Shift-I inspector + +import matplotlib +matplotlib.use('GTK3Agg') # belt-and-braces: make sure +import matplotlib.pyplot as plt + +print('GTK3Agg backend loaded, creating figure…') +fig, ax = plt.subplots() +ax.plot([0, 1], [0, 1]) +ax.set_title('GTK3-Matplotlib window – close it to finish') +print('Showing figure…') +plt.show() +print('plt.show() returned – script ends') + diff --git a/src/tests/scripts/exp.py b/src/tests/scripts/exp.py new file mode 100644 index 0000000..e69de29 diff --git a/src/tests/scripts/res.py b/src/tests/scripts/res.py new file mode 100644 index 0000000..e69de29