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

All results empty #112

Closed
HVEC-lab opened this issue Nov 11, 2022 · 8 comments
Closed

All results empty #112

HVEC-lab opened this issue Nov 11, 2022 · 8 comments

Comments

@HVEC-lab
Copy link

Version 0.3.0 in some cases returns empty results. As yet I have not figured out what triggers this. Will return to version 0.2.6 for now and will let you know if I find out more.

@datpthus
Copy link

datpthus commented Jan 6, 2023

Hello, I also got empty results on Windows but OK on MacOS. Have you figured out yet? @HVEC-lab

@ocefpaf
Copy link
Collaborator

ocefpaf commented Jan 6, 2023

As yet I have not figured out what triggers this.

Can you provide a reproducible example that we can use to debug this?

@datpthus
Copy link

datpthus commented Jan 6, 2023

z4019264181479_a867417ff43f3a992ddc53d28b57c798

@ocefpaf my students install 0.3.0 and this is what they got.

@ocefpaf
Copy link
Collaborator

ocefpaf commented Jan 6, 2023

@datpthus it is virtually impossible for me to reproduce that from a cropped screenshot. Can you send code, in text, with a minimal example that reproduces the problem?

@datpthus
Copy link

datpthus commented Jan 7, 2023

@ocefpaf sorry I misunderstood. Here is the code.

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from scipy import signal
import utide
from datetime import datetime as dt
import matplotlib.dates as mdates
import scipy.interpolate as sc

KLM = pd.read_excel('data.xlsx', dtype={'Y':str,'M':str,'D':str, 'H': str})
dt=KLM['Y']+'/'+KLM['M']+'/'+KLM['D']+' '+KLM['H']+ ':00:00'
KLM ['datetime']=pd.to_datetime(dt)
KLM=KLM.set_index('datetime')

time=mdates.date2num(KLM_jul.index.to_pydatetime())

coef = utide.solve(time,KLM_jul['sealevel'].values,
lat = 20.68,
method='ols',
conf_int='MC')

and then it says "solve: matrix prep ... solution ... done." but nothing is produced
Thanks a lot. And I attached here the data file
data.xlsx

@ocefpaf
Copy link
Collaborator

ocefpaf commented Jan 7, 2023

This works: https://nbviewer.org/urls/gist.githubusercontent.com/ocefpaf/db8d637d24ea63a9be3878eb7167911f/raw/d9acf296b010be7fa0f05eec89b561c1b6070bd6/demo.ipynb

You are passing the wrong input as dates. Latest version takes the pandas datetime index directly now.

@ocefpaf ocefpaf closed this as completed Jan 7, 2023
@datpthus
Copy link

datpthus commented Jan 8, 2023 via email

@HVEC-lab
Copy link
Author

HVEC-lab commented Jan 9, 2023

Ah thanks! So no need to calculate time with respect to epoch anymore?

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

3 participants