Re: grass-session integration into core

Vaclav Petras <[email protected]> Thu, 10 Jun 2021 21:48:40 -0400
Newsgroups gmane.comp.gis.grass.devel
Message-ID <CABo5uVuqPbduT2ZX4JhcMHE5ooBzSZGArOjmVPo213gSB7Ezeg@mail.gmail.com>
--===============4505967503744129096==
Content-Type: multipart/alternative; boundary="000000000000f9a8bf05c473b5d4"

--000000000000f9a8bf05c473b5d4
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Jun 9, 2021 at 3:27 AM Stefan Blumentrath <
[email protected]> wrote:

>
>
> ...I am not sure if it is feasible to throw an informative error message
> if users try to use GRASS functions without a running session=E2=80=A6
>

If you run without the runtime environment (modules are not on path), we
could catch FileNotFoundError in grass.script.start_command() and re-raise
or raise a different exception based on the presence of environmental
variables (such as GISBASE) to help user debug it, although a
troubleshooting or FAQ section may have the similar effect.

If you somehow manage to run with the runtime, but without the
db/location/mapset thingy being open/current, you currently get some
complaint from modules about a LOCATION variable not being defined which is
cryptic, but can be improved.


>  That said, what would the gain of a pip package be? If you install GRASS
> you would have the functionality. If you did not install GRASS you could
> not use a pip package with grass-session like functionality anyway, no?
>

I don't see advantages in a pip package like this either. It would be a
similar scenario as now except that the version sync is better and that it
shows the weirdness of grass-session better: Let's say you build GRASS in a
Docker image. Then, you run pip on part of the source code in order to make
the thing you just built actually work!? Why isn't the grass-session
package installation part of the build if it is  needed anyway to make
GRASS work?

--000000000000f9a8bf05c473b5d4
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"></div><br><div class=3D"gmail_quote"><div=
 dir=3D"ltr" class=3D"gmail_attr">On Wed, Jun 9, 2021 at 3:27 AM Stefan Blu=
mentrath &lt;<a href=3D"mailto:[email protected]">Stefan.Blumentra=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">





<div style=3D"overflow-wrap: break-word;" lang=3D"NO-BOK">
<div class=3D"gmail-m_-3003925133079186970WordSection1"><span lang=3D"EN-US=
"></span>
<p class=3D"MsoNormal"><span lang=3D"EN-US"><u></u>=C2=A0<u></u></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US">...I am not sure if it is feasi=
ble to throw an informative error message if users try to use GRASS functio=
ns without a running session=E2=80=A6</span></p></div></div></blockquote><d=
iv><br></div><div>If you run without the runtime environment (modules are n=
ot on path), we could catch FileNotFoundError in grass.script.start_command=
() and re-raise or raise a different exception based on the presence of env=
ironmental variables (such as GISBASE) to help user debug it, although a tr=
oubleshooting or FAQ section may have the similar effect.</div><div><br></d=
iv><div>If you somehow manage to run with the runtime, but without the db/l=
ocation/mapset thingy being open/current, you currently get some complaint =
from modules about a LOCATION variable not being defined which is cryptic, =
but can be improved.<br></div><div>=C2=A0</div><blockquote class=3D"gmail_q=
uote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,2=
04);padding-left:1ex"><div style=3D"overflow-wrap: break-word;" lang=3D"NO-=
BOK"><div class=3D"gmail-m_-3003925133079186970WordSection1"><p class=3D"Ms=
oNormal"><span lang=3D"EN-US"><u></u><u></u></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US">=C2=A0That said, what would the=
 gain of a pip package be? If you install GRASS you would have the function=
ality. If you did not install GRASS you could not use a pip package with gr=
ass-session
 like functionality anyway, no?</span></p></div></div></blockquote><div><br=
></div><div>I don&#39;t see advantages in a pip package like this either. I=
t would be a similar scenario as now except that the version sync is better=
 and that it shows the weirdness of grass-session better: Let&#39;s say you=
 build GRASS in a Docker image. Then, you run pip on part of the source cod=
e in order to make the  thing you just built actually work!? Why isn&#39;t =
the grass-session package installation part of the build if it is=C2=A0 nee=
ded anyway to make GRASS work?<br></div></div></div>

--000000000000f9a8bf05c473b5d4--

--===============4505967503744129096==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
grass-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/grass-dev

--===============4505967503744129096==--