threedi / hhnk-threedi-plugin

QGIS plugin gebruikt voor analyses van 3Di modellen bij HHNK.
1 stars 0 forks source link

Installatie + documentatie doorlopen + verbeteren #38

Closed d2hydro closed 1 year ago

d2hydro commented 1 year ago

Idee installatie:

Procedure doorlopen, code + handleiding verbeteren:

Updaten depencies.py

Deployment toevoegen:

Documentatie uitwerken:

Kijken of we dit kunnen verbeteren: https://github.com/threedi/hhnk-threedi-plugin/issues/38#issuecomment-1447881974

d2hydro commented 1 year ago

-

wvangerwen commented 1 year ago

Andere python environments werken niet meer direct door de plugin installatie. Dit komt omdat we in "C:\Users\wvangerwen.ipython\profile_default\ipython_config.py" dependencies toevoegen. Dit bestand wordt gedeeld met andere envs.

Onderaan dit bestand komt bijvoorbeeld dit te staan.

c.InteractiveShellApp.exec_lines = ['import sys; sys.path.insert(0,"C:/Users/wvangerwen/AppData/Roaming/3Di/QGIS3/profiles/default/python/plugins/ThreeDiToolbox/deps"); sys.path.insert(0,"C:/Users/wvangerwen/AppData/Roaming/3Di/QGIS3/profiles/default/python/plugins/hhnk_threedi_plugin/external-dependencies"); sys.path.insert(0,"E:/github/wvangerwen/hhnk-threedi-tools"); sys.path.insert(0,"E:/github/wvangerwen/hhnk-research-tools")']

Huidige oplossing om bovenaan alle scripts die andere env gebruiken deze dingen weer weg te halen.

import sys, os
from pathlib import Path

def fix_syspath(verbose=False):
    r"""remove path things that are added in C:\Users\wvangerwen\.ipython\profile_default\ipython_config.py"""
    syspath=sys.path.copy()
    syspathlib = [Path(j) for j in syspath]
    for ii, i in enumerate(['E:/github/wvangerwen/hhnk-threedi-tools',
            os.path.join(os.getenv("APPDATA"), r"3Di/QGIS3/profiles/default/python/plugins/hhnk_threedi_plugin/external-dependencies"),
            os.path.join(os.getenv("APPDATA"), r"3Di/QGIS3/profiles/default/python/plugins/ThreeDiToolbox/deps"),
            os.path.join(os.getenv("APPDATA"), r"\\Python\\Python39\\site-packages")]):

        if Path(i) in syspathlib:
            index = syspathlib.index(Path(i))
            sys.path.remove(syspath[index])
            if verbose:
                print(f"remove {syspath[index]}")
        else:
            if verbose:
                print(f"error {Path(i)}")
d2hydro commented 1 year ago

-

d2hydro commented 1 year ago

-

d2hydro commented 1 year ago

@wvangerwen, zie nieuwe user-docs. Kun jij reviewen en publishen?

Image

Ik heb een nieuwe MI + plugin installatie doorlopen om deze manual te doorlopen, dus bij mij werkt het :-)

d2hydro commented 1 year ago

Plugin kan nu gedownloade worden via: https://github.com/threedi/hhnk-threedi-plugin/releases/latest

d2hydro commented 1 year ago

Documentatie wordt nu automatisch gegenereerd @ release: https://threedi.github.io/hhnk-threedi-plugin/