[GRASS-dev] GSOC 2018 project for GRASS GIS

Hi,

My name is Sanjeet Bhatti and I am an MSc. student in Computer Science
from University of Saskatchewan, Canada. I was going through the list
of GSOC project ideas of GRASS GIS and I found one that caught my
interest: "Full support of Python 3 in GRASS GIS".
I am familiar with python programming as well as have a basic
understanding of wxPython. Currently, I am setting up my development
environment by checking out the development branch (trunk) of GRASS 7
available at this link[0].
Are there any initial tasks that I should be doing apart from listing
the generally used solutions for migrating from Python 2 to 3? And,
where do I need to submit these?

Thank you,
Sanjeet

[0] svn.osgeo.org/grass/grass/

Hi Sanjeet,

On Tue, Feb 27, 2018 at 3:08 AM, Sanjeet <edu.sanjeet@gmail.com> wrote:

Hi,

My name is Sanjeet Bhatti and I am an MSc. student in Computer Science
from University of Saskatchewan, Canada. I was going through the list
of GSOC project ideas of GRASS GIS and I found one that caught my
interest: "Full support of Python 3 in GRASS GIS".

That's great and for sure an important topic to work on!

I am familiar with python programming as well as have a basic
understanding of wxPython. Currently, I am setting up my development
environment by checking out the development branch (trunk) of GRASS 7
available at this link[0].
Are there any initial tasks that I should be doing apart from listing
the generally used solutions for migrating from Python 2 to 3? And,
where do I need to submit these?

There are some tickets flagged with "python3":
https://trac.osgeo.org/grass/query?status=!closed&keywords=~python3

I suppose that more tickets should carry that keyword but they need to
be identified by scanning those with "python" keyword.

The topic suggestions are posted here (as you know):
https://trac.osgeo.org/grass/wiki/GSoC/2018

but did you already check this page?
https://wiki.osgeo.org/wiki/Google_Summer_of_Code_Recommendations_for_Students

Best
Markus

Thank you,
Sanjeet

[0] svn.osgeo.org/grass/grass/
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

On Wed, Feb 28, 2018 at 3:38 PM, Markus Neteler <neteler@osgeo.org> wrote:

Hi Sanjeet,

On Tue, Feb 27, 2018 at 3:08 AM, Sanjeet <edu.sanjeet@gmail.com> wrote:

Hi,

My name is Sanjeet Bhatti and I am an MSc. student in Computer Science
from University of Saskatchewan, Canada. I was going through the list
of GSOC project ideas of GRASS GIS and I found one that caught my
interest: “Full support of Python 3 in GRASS GIS”.

That’s great and for sure an important topic to work on!

I am familiar with python programming as well as have a basic
understanding of wxPython. Currently, I am setting up my development
environment by checking out the development branch (trunk) of GRASS 7
available at this link[0].
Are there any initial tasks that I should be doing apart from listing
the generally used solutions for migrating from Python 2 to 3? And,
where do I need to submit these?

There are some tickets flagged with “python3”:
https://trac.osgeo.org/grass/query?status=!closed&keywords=~python3

What is the policy about the python shebang explained in python PEP 394
https://www.python.org/dev/peps/pep-0394/


In order to tolerate differences across platforms, all new code that needs to invoke the Python interpreter should not specify python, but rather should specify either python2 or python3 (or the more specific python2.x and python3.x versions; see the Migration Notes). This distinction should be made in shebangs, when invoking from a shell script, when invoking via the system() call, or when invoking in any other context.

… unless scripts are deliberately written to be source compatible with both Python 2.x and 3.x

Currently packagers replace python with python2 in the shebang of GRASS scripts.

Markus M

I suppose that more tickets should carry that keyword but they need to
be identified by scanning those with “python” keyword.

The topic suggestions are posted here (as you know):
https://trac.osgeo.org/grass/wiki/GSoC/2018

but did you already check this page?
https://wiki.osgeo.org/wiki/Google_Summer_of_Code_Recommendations_for_Students

Best
Markus

Thank you,
Sanjeet

[0] svn.osgeo.org/grass/grass/


grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev


grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Hi Sanjeet,

On Mon, Feb 26, 2018 at 9:08 PM, Sanjeet <edu.sanjeet@gmail.com> wrote:

Hi,

My name is Sanjeet Bhatti and I am an MSc. student in Computer Science
from University of Saskatchewan, Canada. I was going through the list
of GSOC project ideas of GRASS GIS and I found one that caught my
interest: "Full support of Python 3 in GRASS GIS".
I am familiar with python programming as well as have a basic
understanding of wxPython. Currently, I am setting up my development
environment by checking out the development branch (trunk) of GRASS 7
available at this link[0].
Are there any initial tasks that I should be doing apart from listing
the generally used solutions for migrating from Python 2 to 3? And,
where do I need to submit these?

I would leave that up to you, you can send it in email, post it on
your github or whatever seems convenient for you.
Regarding the GUI, you can look at this ticket:
https://trac.osgeo.org/grass/ticket/3510

Basically, the GUI is mostly ported to work with wxPython4 (phoenix),
which is (unlike wxpython 3) Python 3 ready. So far we are running the
GUI on Python 2.7 only. There are some loose ends and depreciation
warnings, which would be nice to get rid of. Since we need to keep
backwards compatibility with wxpython 3, we wrapped some GUI classes
(gui/wxpython/gui_core/wrap.py), so you can start there. You need to
test your changes under both wxpython 3 and 4. Let me know if you need
more clarification. More info what is Attribute Table manager:

https://grass.osgeo.org/grass75/manuals/wxGUI.dbmgr.html
https://grasswiki.osgeo.org/wiki/WxGUI_Attribute_Table_Manager

To post a patch in that ticket, you need to get osgeo id:
https://www.osgeo.org/community/getting-started-osgeo/osgeo_userid/

Best,

Anna

Thank you,
Sanjeet

[0] svn.osgeo.org/grass/grass/
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

On Wed, Feb 28, 2018 at 8:38 AM, Markus Neteler <neteler@osgeo.org> wrote:

There are some tickets flagged with "python3":
https://trac.osgeo.org/grass/query?status=!closed&keywords=~python3

I suppose that more tickets should carry that keyword but they need to
be identified by scanning those with "python" keyword.

The topic suggestions are posted here (as you know):
https://trac.osgeo.org/grass/wiki/GSoC/2018

but did you already check this page?
https://wiki.osgeo.org/wiki/Google_Summer_of_Code_Recommendations_for_Students

Hi Markus,

Thanks for sharing the links. I've gone through them now.

--
Sanjeet Bhatti

On Sat, Mar 3, 2018 at 10:50 PM, Anna Petrášová <kratochanna@gmail.com> wrote:

Hi Sanjeet,

Hi Anna,

On Mon, Feb 26, 2018 at 9:08 PM, Sanjeet <edu.sanjeet@gmail.com> wrote:

I would leave that up to you, you can send it in email, post it on
your github or whatever seems convenient for you.

I will share the list soon.

Regarding the GUI, you can look at this ticket:
https://trac.osgeo.org/grass/ticket/3510

Basically, the GUI is mostly ported to work with wxPython4 (phoenix),
which is (unlike wxpython 3) Python 3 ready. So far we are running the
GUI on Python 2.7 only. There are some loose ends and depreciation
warnings, which would be nice to get rid of. Since we need to keep
backwards compatibility with wxpython 3, we wrapped some GUI classes
(gui/wxpython/gui_core/wrap.py), so you can start there. You need to
test your changes under both wxpython 3 and 4. Let me know if you need
more clarification. More info what is Attribute Table manager:

https://grass.osgeo.org/grass75/manuals/wxGUI.dbmgr.html
https://grasswiki.osgeo.org/wiki/WxGUI_Attribute_Table_Manager

Meanwhile, I've setup my development environment and compiled the
source code. I did not see the warning messages when I opened the
Attribution Table Manager as mentioned in the ticket #3510 even when I
installed wxpython 4 (on system Ubuntu 16.04 with Python 2.7.x).

Is it supposed to be displaying in the console? Because I did not get
any warnings.
I even tried to set the g.gisenv set="DEBUG=5" to print the debugging
messages along with WX_DEBUG. Am I missing some step?

Thanks
--
Sanjeet Bhatti

On Mon, Mar 5, 2018 at 7:20 PM, Sanjeet <edu.sanjeet@gmail.com> wrote:

On Sat, Mar 3, 2018 at 10:50 PM, Anna Petrášová <kratochanna@gmail.com> wrote:

Hi Sanjeet,

Hi Anna,

On Mon, Feb 26, 2018 at 9:08 PM, Sanjeet <edu.sanjeet@gmail.com> wrote:

I would leave that up to you, you can send it in email, post it on
your github or whatever seems convenient for you.

I will share the list soon.

Regarding the GUI, you can look at this ticket:
https://trac.osgeo.org/grass/ticket/3510

Basically, the GUI is mostly ported to work with wxPython4 (phoenix),
which is (unlike wxpython 3) Python 3 ready. So far we are running the
GUI on Python 2.7 only. There are some loose ends and depreciation
warnings, which would be nice to get rid of. Since we need to keep
backwards compatibility with wxpython 3, we wrapped some GUI classes
(gui/wxpython/gui_core/wrap.py), so you can start there. You need to
test your changes under both wxpython 3 and 4. Let me know if you need
more clarification. More info what is Attribute Table manager:

https://grass.osgeo.org/grass75/manuals/wxGUI.dbmgr.html
https://grasswiki.osgeo.org/wiki/WxGUI_Attribute_Table_Manager

Meanwhile, I've setup my development environment and compiled the
source code. I did not see the warning messages when I opened the
Attribution Table Manager as mentioned in the ticket #3510 even when I
installed wxpython 4 (on system Ubuntu 16.04 with Python 2.7.x).

Is it supposed to be displaying in the console? Because I did not get
any warnings.
I even tried to set the g.gisenv set="DEBUG=5" to print the debugging
messages along with WX_DEBUG. Am I missing some step?

Look in the GUI console (second tab at the bottom in Layer Manager).
You can check if you are indeed running wxpython 4 easily from GUI, go
to Python tab and try:

import wx
wx.version()

4.0.1 gtk2 (phoenix)

I would recommend running it in virtualenv.

Thanks
--
Sanjeet Bhatti

On Mon, Mar 5, 2018 at 6:43 PM, Anna Petrášová <kratochanna@gmail.com> wrote:

Look in the GUI console (second tab at the bottom in Layer Manager).
You can check if you are indeed running wxpython 4 easily from GUI, go
to Python tab and try:

import wx
wx.version()

4.0.1 gtk2 (phoenix)

I would recommend running it in virtualenv.

Yes, I see them now. Thanks!

--
Sanjeet Bhatti

On Sat, Mar 3, 2018 at 10:50 PM, Anna Petrášová <kratochanna@gmail.com> wrote:

Basically, the GUI is mostly ported to work with wxPython4 (phoenix),
which is (unlike wxpython 3) Python 3 ready. So far we are running the
GUI on Python 2.7 only. There are some loose ends and depreciation
warnings, which would be nice to get rid of. Since we need to keep
backwards compatibility with wxpython 3, we wrapped some GUI classes
(gui/wxpython/gui_core/wrap.py), so you can start there. You need to
test your changes under both wxpython 3 and 4. Let me know if you need
more clarification. More info what is Attribute Table manager:

https://grass.osgeo.org/grass75/manuals/wxGUI.dbmgr.html
https://grasswiki.osgeo.org/wiki/WxGUI_Attribute_Table_Manager

Hi Anna,

I've created a patch file for the ticket #3510.

To post a patch in that ticket, you need to get osgeo id:
https://www.osgeo.org/community/getting-started-osgeo/osgeo_userid/

I'm waiting for 'mantra' to create the osgeo user id, so that I can
upload the patch file.

--
Sanjeet Bhatti

On Tue, Mar 6, 2018 at 5:37 AM, Sanjeet <edu.sanjeet@gmail.com> wrote:

On Sat, Mar 3, 2018 at 10:50 PM, Anna Petrášová <kratochanna@gmail.com>
wrote:
> Basically, the GUI is mostly ported to work with wxPython4 (phoenix),
> which is (unlike wxpython 3) Python 3 ready. So far we are running the
> GUI on Python 2.7 only. There are some loose ends and depreciation
> warnings, which would be nice to get rid of. Since we need to keep
> backwards compatibility with wxpython 3, we wrapped some GUI classes
> (gui/wxpython/gui_core/wrap.py), so you can start there. You need to
> test your changes under both wxpython 3 and 4. Let me know if you need
> more clarification. More info what is Attribute Table manager:
>
> https://grass.osgeo.org/grass75/manuals/wxGUI.dbmgr.html
> https://grasswiki.osgeo.org/wiki/WxGUI_Attribute_Table_Manager

Hi Anna,

I've created a patch file for the ticket #3510.

> To post a patch in that ticket, you need to get osgeo id:
> https://www.osgeo.org/community/getting-started-osgeo/osgeo_userid/

I'm waiting for 'mantra' to create the osgeo user id, so that I can
upload the patch file.

What's your username?

--
Margherita Di Leo

Sanjeet,
Spotted this the other day if it helps.

https://medium.com/@boxed/moving-a-large-and-old-codebase-to-python3-33a5a13f8c99

Doug

···

On Tue, Mar 6, 2018 at 4:38 AM, Margherita Di Leo <diregola@gmail.com> wrote:


grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

On Tue, Mar 6, 2018 at 5:37 AM, Sanjeet <edu.sanjeet@gmail.com> wrote:

On Sat, Mar 3, 2018 at 10:50 PM, Anna Petrášová <kratochanna@gmail.com> wrote:

Basically, the GUI is mostly ported to work with wxPython4 (phoenix),
which is (unlike wxpython 3) Python 3 ready. So far we are running the
GUI on Python 2.7 only. There are some loose ends and depreciation
warnings, which would be nice to get rid of. Since we need to keep
backwards compatibility with wxpython 3, we wrapped some GUI classes
(gui/wxpython/gui_core/wrap.py), so you can start there. You need to
test your changes under both wxpython 3 and 4. Let me know if you need
more clarification. More info what is Attribute Table manager:

https://grass.osgeo.org/grass75/manuals/wxGUI.dbmgr.html
https://grasswiki.osgeo.org/wiki/WxGUI_Attribute_Table_Manager

Hi Anna,

I’ve created a patch file for the ticket #3510.

To post a patch in that ticket, you need to get osgeo id:
https://www.osgeo.org/community/getting-started-osgeo/osgeo_userid/

I’m waiting for ‘mantra’ to create the osgeo user id, so that I can
upload the patch file.

What’s your username?

Margherita Di Leo

Doug Newcomb
USFWS
551F Pylon Dr
Raleigh, NC
919-856-4520 ext. 14 doug_newcomb@fws.gov

__NOTE: This email correspondence and any attachments to and from this sender is subject to the Freedom of Information Act (FOIA) and may be disclosed to third parties.__​

On Mar 6, 2018 3:38 AM, "Margherita Di Leo" <diregola@gmail.com> wrote:

On Tue, Mar 6, 2018 at 5:37 AM, Sanjeet <edu.sanjeet@gmail.com> wrote:

On Sat, Mar 3, 2018 at 10:50 PM, Anna Petrášová <kratochanna@gmail.com>
wrote:

Hi Anna,

I've created a patch file for the ticket #3510.

> To post a patch in that ticket, you need to get osgeo id:
> https://www.osgeo.org/community/getting-started-osgeo/osgeo_userid/

I'm waiting for 'mantra' to create the osgeo user id, so that I can
upload the patch file.

What's your username?

Hi Margherita,

I got the email from osgeo and I was able to proceed further and create id.
So, my osgeo userid is 'sanjeet'. Is this the username that you were
referring to?

Thanks

On Mar 6, 2018 11:26 AM, "Newcomb, Doug" <doug_newcomb@fws.gov> wrote:

Sanjeet,
Spotted this the other day if it helps.

https://medium.com/@boxed/moving-a-large-and-old-codebase-to-python3-
33a5a13f8c99

Hi Doug,

Thank you so much for sharing that. It is going to be really helpful in
listing the steps to port to python 3.

Sanjeet