Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking pixellimit for r.import commands #491

Merged
merged 14 commits into from
Nov 21, 2023
Merged

Conversation

linakrisztian
Copy link
Member

@linakrisztian linakrisztian commented Oct 26, 2023

Check the current r.import command against the user cell limit (within ephemeral_processing.py) + added tests for this check

PR additionally contains small linting changes:

  • test_download_cache.py (line too long)
  • format markdown

@mmacata mmacata mentioned this pull request Nov 2, 2023
@neteler
Copy link
Member

neteler commented Nov 9, 2023

May I suggest adding a test test_download_commands_vsicurl similar to

def test_download_commands_tif(self):

The test may then execute two imports:

@linakrisztian
Copy link
Member Author

@neteler Good hint, I will add a test and thanks for the example data.
I had a look and I think it is not reasonable to put it into actinia-core/tests/test_geodata_import.py. Within this test the download and import for vector and raster data is tested.
I will create some separate test-file test_raster_import_pixellimit.py, checking the pixellimit for all r.import commands.

@linakrisztian linakrisztian marked this pull request as ready for review November 20, 2023 11:16
Copy link
Member

@mmacata mmacata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, well done!

Please rename the tests like suggested or in another way, a negation in the title makes me expect a 400.
Other than that I "only" have ideas for more tests like using the importer, testing the same with ephemeral processing, ... but no blocker for me to be merged like this because tests for two cases exist.

tests/test_raster_import_pixellimit.py Outdated Show resolved Hide resolved
tests/test_raster_import_pixellimit.py Outdated Show resolved Hide resolved
This method will raise an AsyncProcessError exception

"""
rimport_inp = [x for x in process_executable_params if "input=" in x][
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point, an importer command would already be translated to r.import, right? So the following would be parsed correctly because it is already transformed?:

 {
            "id": "importer_1",
            "module": "importer",
            "inputs": [
                {
                    "import_descr": {
                        "source": "https://raw.githubusercontent.com/mmacata/pagestest/gh-pages/bonn.geojson",
                        "type": "vector"
                    },
                    "param": "map",
                    "value": "polygon"
                }
            ]
        },

(Maybe add an importer PC to the tests below?) 🙃

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is already transformed at this point. I also added a test for the importer

@linakrisztian linakrisztian merged commit a01244a into main Nov 21, 2023
8 checks passed
@linakrisztian linakrisztian deleted the rimoprt_check_pixellimit branch November 21, 2023 15:00
@linakrisztian linakrisztian added this to the 4.12.0 milestone Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants