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

Converting Shiny weather data with the Metadata processor: bugs and issues #687

Open
CsillaVG opened this issue Dec 13, 2024 · 7 comments
Open

Comments

@CsillaVG
Copy link

Hi Team,

There comes my concise write-up.
Thanks for all the work!
Best,
Csilla

Shiny weather data offers four output formats, out of which two could be relevant to UMEP.

1 .CSV

At the moment, under all my os-QGIS variations, loading the csv file is not possible. I receive the error of "If invalid data was detected such as strings or other non-numrical characters, these data points could result in that the MetdataProcessor will fail to create your UMEP-formatted inputdata." and the interface remains locked (without the possibility to assign the column names to various meteorological parameters).
This is most likely caused my the formatting of the file that starts with 11 lines of header lines that begin with a hash sign. Unfortunately, setting the 'Number of header lines' in the interface to 12 or higher does not resolve the issue. See attached screenshot.

Image

Attached is a csv file for reference:
Chicago2020LT.csv

2 .EPW

The epw conversion works, apart from the hard-coded year of 1985 (noted earlier). While one could replace the year in the resultant file with the help of a text editor, the problem becomes more complex when the supplied Actual Meteorological Year (AMY) is a leap year. Put simply, the current code results in duplicate datetime labels, when leap year is fed in, eventually, causing a 24-hour shift in the data following the leap day. Fixing this can be challenging to those without solid Excel or scripting skills.

Attached is an UMEP-converted epw file for reference:
Chicago2020LTepw.txt

@biglimp
Copy link
Contributor

biglimp commented Dec 16, 2024

Thanks Csilla,
Your first point is actually a bug that I just found will fix this. The 1985 hardcode should noew be fix (in the development release).

biglimp added a commit that referenced this issue Dec 16, 2024
Response to #687 and minor fix in SUEWS DB Prepare
@biglimp
Copy link
Contributor

biglimp commented Dec 16, 2024

Both issues should now be fixed. Check out new development release.

@CsillaVG
Copy link
Author

Fantastic, thank you!

@CsillaVG
Copy link
Author

The attempt to install the development release lands in a SyntaxError: (f-string: unmatched '[')

Here is the full error message ::
Couldn't load plugin 'UMEP-SuPy-QGIS3' due to an error when calling its classFactory() method

SyntaxError: f-string: unmatched '['
Traceback (most recent call last):
File "/Users/vuk/miniconda3/envs/fooqgis/share/qgis/python/qgis/utils.py", line 426, in _startPlugin
plugins[packageName] = package.classFactory(iface)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/vuk/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/UMEP-SuPy-QGIS3/init.py", line 42, in classFactory
from .UMEP import UMEP
File "/Users/vuk/miniconda3/envs/fooqgis/share/qgis/python/qgis/utils.py", line 966, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/vuk/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/UMEP-SuPy-QGIS3/UMEP.py", line 68, in
from .suews_database_manager.suews_database_manager import suews_database_manager
File "/Users/vuk/miniconda3/envs/fooqgis/share/qgis/python/qgis/utils.py", line 966, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/vuk/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/UMEP-SuPy-QGIS3/suews_database_manager/suews_database_manager.py", line 56, in
from .utilities.suews_SS import setup_SUEWS_SS_creator
File "/Users/vuk/miniconda3/envs/fooqgis/share/qgis/python/qgis/utils.py", line 966, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/vuk/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/UMEP-SuPy-QGIS3/suews_database_manager/utilities/suews_SS.py", line 165
QMessageBox.information(None, 'Succesful', f'New edit {spartacus_dict['Name']}, {spartacus_dict['Origin']} added to your local database')
^^^^
SyntaxError: f-string: unmatched '['

Environment ::
macOS Ventura 13.2
QGIS version: 3.40.1-Bratislava
Python version: 3.11.11
UMEP 4.3.2
UMEP for processing 2.0.35
SuPy version: 2024.5.24.dev

@biglimp biglimp reopened this Dec 17, 2024
@biglimp
Copy link
Contributor

biglimp commented Dec 17, 2024

Try now.

@CsillaVG
Copy link
Author

CsillaVG commented Dec 17, 2024

Unfortunately, I got the same exact error.
I'll try to install QGIS into a 3.12 python environment and see if this helps with the issue, or just opens a new can of worms...
It does work under Windows 11.

@biglimp
Copy link
Contributor

biglimp commented Dec 18, 2024

Ok, Let us know if you find a solution for Mac.

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

No branches or pull requests

2 participants