-
-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nishant Bansal <[email protected]>
- Loading branch information
1 parent
02861c2
commit 7ff9c1b
Showing
4 changed files
with
495 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"""Fixture for r.category test""" | ||
|
||
import os | ||
import pytest | ||
import grass.script as gs | ||
|
||
|
||
@pytest.fixture | ||
def simple_dataset(tmp_path): | ||
"""Set up a GRASS session and create test rasters with color rules.""" | ||
project = tmp_path / "raster_color_project" | ||
gs.create_project(project) | ||
with gs.setup.init(project, env=os.environ.copy()) as session: | ||
gs.run_command( | ||
"g.region", | ||
s=0, | ||
n=100, | ||
w=0, | ||
e=100, | ||
res=10, | ||
env=session.env, | ||
) | ||
gs.mapcalc("test = if(col() < 3, col(), 2)", env=session.env) | ||
gs.mapcalc("test_1 = if(col() < 5, col(), 4)", env=session.env) | ||
gs.mapcalc("test_d = if(col() < 5, col() / 2., 4.5)", env=session.env) | ||
|
||
yield session |
Oops, something went wrong.