-
-
Notifications
You must be signed in to change notification settings - Fork 339
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
grass.jupyter: Create BaseSeriesMap to remove redundancies in SeriesMap and TimeSeriesMap #3468
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good start, but there is still a lot of overlap e.g. in show()
and save()
methods that should be addressed.
Hello @petrasovaa, Thank you for your suggestions. I've taken the necessary steps as per your recommendations. However, I'm encountering difficulties with my setup, specifically regarding the proper installation of GRASS on my PC. I'm utilizing WSL and attempting to install GRASS by following the instructions outlined in this guide. Despite following the guide, I'm encountering errors during the execution of pytest, which displays a Subsequently, I attempted to reinstall the package, yet encountered another issue indicating Could you please provide guidance on resolving these issues? Thank you. |
Just to make sure, you compiled doing ./configure
make
make install Where there were flags to Then, to make sure everything is installed, which grass Returns where it is installed,
Opens the command line greeting you inside grass. |
Yes @echoix, I have followed the same steps with flags to |
I either use Gitpod which runs an Ubuntu container online, or use Ubuntu 22.04 in WSL when developing locally. I've been using WSL since the beginning. I assume you are not using the WSL1, but the WSL2 which is Hyper-V-based, essentially a Linux VM, with great Windows integration. grass/.github/workflows/pytest.yml Lines 67 to 79 in 44ea597
Note that we don't install in the normal prefix (we use $HOME/install), but it could be anywhere, that's not a problem. But there's something particular in your setup (since using WSL) that will make your development a bit harder. Remember how WSL2 is simply a Linux VM? You have files that reside in your Linux installation, but can also access the Windows filesystem throughout the mounted drives in |
Thanks @echoix! I attempted to place the files in my Linux filesystem, but encountered the same error. Ultimately, I decided to reinstall my WSL, and everything worked smoothly thereafter. |
Great to hear! And it's not a bad thing either! That's why I love using Gitpod, (same as GitHub codespaces, but existed before). I'm fresh each time I start something new. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added couple of comments I ran into while testing the code.
Hi @petrasovaa, I have made the major following changes:
I'd also like to inform you about an issue I encountered during my setup while running the test for |
SeriesMap was added recently, it's only in the main branch, so you need to work with the latest code. |
Thank you, I am not sure I will be able to review it today, but I'll try |
The Python files being available to use as imports work after a make install, as it's when they are copied to the correct location and hierarchy to be able to be used. Changing branches that much and having problems after that, especially if it is with Python files that are created from a C module binding, I would expect you might need to run
|
Thank @echoix! This worked out. |
I would've also deleted the directory where I installed too, to make sure everything was clean (ie files that are not there anymore could not get removed by installing upon it) |
Did it already to avoid the chaos. ✌️ |
I'm encountering an issue while running tests locally on my PC. I've been referring to the testing source code and module and running the test framework documentation on the GRASS GIS website. In the
Could you please provide guidance on what might be causing this issue? |
Sorry, there is no way for you to know this, but there we are experimentally using pytest, so you need to run: PYTHONPATH=$(~/Projects/grass/code/grass/bin.x86_64-pc-linux-gnu/grass --config python-path):$PYTHONPATH pytest . To run the grass.gunittest, you just need to be in a parent directory for it to find the However, if you know Jupyter notebooks, it advantageous if you run the examples in Whether you go with the pytest tests or the notebook, you need to run it in your development environment to shorten the feedback loop. (The CI shows the specific issues quite nicely, but locally compiling just the directory and testing the relevant code takes fraction of the time CI needs to complete.) |
Didn't have time to look at this more closely today, but at this point it's best to focus on being able to test the changes and fixing the problems the CI found, it will make any further development and review much easier. |
Sure thing @petrasovaa. I'll prioritize testing the changes and addressing the CI findings by the end of today. |
Thank you for the detailed instructions, @wenzeslaus! I've successfully run the pytest tests in the way mentioned by you. Additionally, I revisited the |
dfa8c17
to
3bac6c0
Compare
@petrasovaa I have made one major change by defining an attribute All of the tests except the PythonCode Quality check got passed, which failed because I had defined 14 attributes instead of 12. Could you please guide me further? |
I will get back to you on this, I need myself more time to see what is the best way to proceed. The way you have it now is not how base classes typically look like, although it technically works. I appreciate you are working on this, it's perhaps a more difficult task than I envisioned. |
65d26a6
to
6f229ab
Compare
Please test it in a notebook, running pytest is not enough, it doesn't cover everything. I am getting errors when I try to run it for both timeseriesmap and seriesmap, something's wrong with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also remove all the commented old code.
Also please address the pylint complaint:
grass/jupyter/baseseriesmap.py:112:8: W0201: Attribute 'base_file' defined outside __init__ (attribute-defined-outside-init)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make the pylint check pass, increase the limit in the configuration, we don't want this to be too strict:
diff --git a/python/.pylintrc b/python/.pylintrc
index 0aed22e524..0df20a6e3b 100644
--- a/python/.pylintrc
+++ b/python/.pylintrc
@@ -568,7 +568,7 @@ max-args=12
# Maximum number of attributes for a class (see R0902).
# We tend to have classes with more attributes than the default 7.
-max-attributes=12
+max-attributes=15
# Maximum number of boolean expressions in an if statement (see R0916).
max-bool-expr=5
…ap and TimeSeriesMap (OSGeo#3468) Co-authored-by: Anna Petrasova <[email protected]>
… SeriesMap and TimeSeriesMap (OSGeo#3468)"
…ap and TimeSeriesMap (OSGeo#3468) Co-authored-by: Anna Petrasova <[email protected]>
Solves #3276