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

Dev #161

Merged
merged 15 commits into from
Oct 15, 2023
Merged

Dev #161

merged 15 commits into from
Oct 15, 2023

Conversation

brey
Copy link
Collaborator

@brey brey commented Aug 31, 2023

No description provided.

brey added 6 commits August 31, 2023 18:50
Use symlink for hgrid.ll
save coastlines to file instead of the model json file - resolve ec-jrc#130
add control for external station dataframe dtype of lat/lon
make sure the test works with symlinks
simplify more
# ---------------------------------------------------------------------
logger.info("model finished successfully\n")
# ---------------------------------------------------------------------

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not a biggie, but would it make sense to move this log message inside execute_schism_mpirun_script()?

I guess the answer depends on whether the function is being used elsewhere

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess, if we put it in tools the logging reference will also be different.

pyposeidon.schism run:671 executing model
pyposeidon.tools :xxx model finished successfully

which might be misleading as well, but I am open to it if you think it's better.

pyposeidon/schism.py Show resolved Hide resolved
pyposeidon/utils/cast.py Outdated Show resolved Hide resolved
pyposeidon/utils/cast.py Outdated Show resolved Hide resolved
@pmav99
Copy link
Collaborator

pmav99 commented Sep 1, 2023

With the first 6 days of May 2023 we get an exception:

  5%|█████████▋                                                                                                                                                                                       | 48/961 [00:00<00:04, 187.58it/s]
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
File /mnt/to_thalassa/run.py:50
     47 end_time = pd.Timestamp("2023-05-06T00:00:00")
     48 stations = gpd.read_file("base_model/stations.json")
---> 50 ods = compute_obs(stations=stations, start_time=start_time, end_time=end_time)
     51 save_ods(ods)
     52 1/0

File /mnt/micromamba/envs/pos_dev/lib/python3.10/site-packages/pyposeidon/utils/post.py:55, in compute_obs(stations, start_time, end_time)
     52     if oi[var].isnull().all().values == True:
     53         oi = oi.drop(var)
---> 55 var = [k for k, v in oi.data_vars.items() if v.dims == ("time",)][0]
     57 obs = oi[var].to_dataframe().drop(["location"], axis=1)  # Get observational data
     59 # de-tide obs
     60 #        if not obs[var].dropna().empty | (obs[var].dropna() == obs[var].dropna()[0]).all():
     61 #            obs = get_ss(obs, oi.lat.values)
     62 #            oi[var].values = obs.elev.values

IndexError: list index out of range

moving to list of variables as argument for one call functionality
@pmav99 pmav99 marked this pull request as ready for review October 15, 2023 15:48
@pmav99 pmav99 merged commit 318c2e1 into ec-jrc:master Oct 15, 2023
4 checks passed
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.

2 participants