Coder Social home page Coder Social logo

Comments (8)

mxkpp avatar mxkpp commented on August 18, 2024 1

@wenzeslaus understood. I'd be glad to revisit and open a PR when I'm able.

from grass-addons.

neteler avatar neteler commented on August 18, 2024

Please note that the GRASS GIS 7 addons are available in a different branch ("grass7/"):

https://github.com/OSGeo/grass-addons/blob/grass7/src/vector/v.surf.nnbathy/nnbathy.py

Can you try that first? (of course the recommendation is to use GRASS GIS 8).

from grass-addons.

mxkpp avatar mxkpp commented on August 18, 2024

Yes, that's the branch I took the permalink from. It's the same in the grass8 branch too though. Unless this is supposed to run in Python 2, I don't see how it could work if StandardError is not in the Python 3 namespace.

from grass-addons.

tmszi avatar tmszi commented on August 18, 2024

According doc for porting Python 2 code to version 3: "The recommended fixer will replace all uses of StandardError with Exception. Review the result to check if this is correct".

Could @mxkpp share full Python command for running v.surf.nnbathy module, please?

from grass-addons.

mxkpp avatar mxkpp commented on August 18, 2024

Sorry for the delay. Below is the way the v.surf.nnbathy module is being invoked. Unfortunately I'm not able to share input data or more of the code context (though I don't think that is necessary to see how the existing module would have a problem in Python 3).

from grass_session import Session
import grass.script as gs

gs.set_raise_on_error(True)
gs.set_capture_stderr(True)

session_args = {"gisdb": "/app/data/grassdata/foobar", "location": "foobar", "mapset": "PERMANENT", "create_opts": ""}

with Session(**session_args):
    gs.run_command(
            "v.surf.nnbathy",
            input_="input_foobar",
            output="output_foobar",
            column="column_foobar",
            algorithm="nn",
            overwrite="true"
        )

from grass-addons.

wenzeslaus avatar wenzeslaus commented on August 18, 2024

Fix is now in #981. @mxkpp or @rmarzocchi84 if you want to give thumbs up for the PR or even pick up implementing an actual fix or fixing some of the Pylint warnings, this would be a good time. In any case, #981 can be merged soon.

from grass-addons.

mxkpp avatar mxkpp commented on August 18, 2024

Thanks all, I did not get a chance to look but I see it was merged into grass8 branch. btw it affects grass7 too (and maybe others), anything using Python 3.

from grass-addons.

wenzeslaus avatar wenzeslaus commented on August 18, 2024

If you want to update it for v7 or anything else, please open an PR and feel free to cherry pick (git cherry-pick) the commit from grass8 branch. We will be happy to merge it, but we can't go beyond that in supporting the legacy version given the resources we have at our disposal.

from grass-addons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.