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

update schimpy.station.py for flux.out format #24

Open
lily-tomkovic-DWR opened this issue Aug 29, 2022 · 1 comment
Open

update schimpy.station.py for flux.out format #24

lily-tomkovic-DWR opened this issue Aug 29, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@lily-tomkovic-DWR
Copy link
Contributor

  • schimpy version: 1.3.4+30.gc1ed8e8
  • Python version: 3.7.13
  • Operating System: Windows 10

Description

In running the station.py command read_flux_out() with outputs found in the Hello SCHISM tutorial, the following error arises:
File "C:\Users%userprofile%\Miniconda3\envs\schimpy\lib\site-packages\schimpy\station.py", line 304, in flux_stations_from_yaml
if not "linestrings" in content: raise ValueError("Could not fine 'linestrings' key. Was the input a string or filename? Valid file?")

I think this might be an issue of updated formatting for flux.out in SCHISM 5.10?

What I Did

station_fpath = '../flow_station_xsects.yaml'
time_basis = datetime.datetime(2009, 2, 10)
set_color_cycle_dark2()

outputs_fpath = "../outputs/flux.out"
station_name = "montezuma_mouth"

all_ts = read_flux_out(outputs_fpath, station_fpath, time_basis)

Traceback (most recent call last):
File "C:\Users%userprofile%\Miniconda3\envs\schimpy\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Users%userprofile%\Miniconda3\envs\schimpy\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "c:\Users%userprofile%.vscode\extensions\ms-python.python-2022.12.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy_main
.py", line 39, in
cli.main()
File "c:\Users%userprofile%.vscode\extensions\ms-python.python-2022.12.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 430, in main
run()
File "c:\Users%userprofile%.vscode\extensions\ms-python.python-2022.12.1\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 284, in run_file
runpy.run_path(target, run_name="main")
File "c:\Users%userprofile%.vscode\extensions\ms-python.python-2022.12.1\pythonFiles\lib\python\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 322, in run_path
pkg_name=pkg_name, script_name=fname)
File "c:\Users%userprofile%.vscode\extensions\ms-python.python-2022.12.1\pythonFiles\lib\python\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 136, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "c:\Users%userprofile%.vscode\extensions\ms-python.python-2022.12.1\pythonFiles\lib\python\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 124, in _run_code
exec(code, run_globals)
File "d:\SCHISM\Hello_SCHISM_Tutorial\tutorial_workshop_5.10\t1_output\exercises\exercise2.py", line 15, in
all_ts = read_flux_out(outputs_fpath, station_fpath, time_basis)
File "C:\Users%userprofile%\Miniconda3\envs\schimpy\lib\site-packages\schimpy\station.py", line 327, in read_flux_out
names = station_names_from_file(names)
File "C:\Users%userprofile%\Miniconda3\envs\schimpy\lib\site-packages\schimpy\station.py", line 319, in station_names_from_file
station_names = flux_stations_from_yaml(fpath)
File "C:\Users%userprofile%\Miniconda3\envs\schimpy\lib\site-packages\schimpy\station.py", line 304, in flux_stations_from_yaml
if not "linestrings" in content: raise ValueError("Could not fine 'linestrings' key. Was the input a string or filename? Valid file?")
ValueError: Could not fine 'linestrings' key. Was the input a string or filename? Valid file?

@water-e
Copy link
Contributor

water-e commented Jul 20, 2023

What does the top of the file look like? Should look like this (format, not the particular station):

linestrings:
- agency_id: B95541
  coordinates:
  - - 642050.
    - 4188627.
  - - 642065.
    - 4188614.
  name: MRU
  station_id: MRU
  station_name: Middle River at Undine Road

@kjnam kjnam added the enhancement New feature or request label Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants