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

Running within Jupyter notebook #49

Open
brey opened this issue Oct 13, 2016 · 3 comments
Open

Running within Jupyter notebook #49

brey opened this issue Oct 13, 2016 · 3 comments

Comments

@brey
Copy link

brey commented Oct 13, 2016

Hi All,

I appreciate your work. I love the fact that this is a command line tool.
However, can you post an example of how to use it as a python module (e.g. inside a Jupyter Notebook)

@tnipen
Copy link
Contributor

tnipen commented Oct 14, 2016

Thanks for the comments brey! Yes, this is a good idea and is something I'd like to make possible. The package is a bit confusing at the moment, but I'm working to improve it so that it can be used as a module. What kind of use case do you have in mind?

For now, something like this could be used to compute some of the scores (by using the most recent version of the code):
import verif.metric
import numpy as np

# Create random data
obs = np.random.randn(100)
fcst = np.random.randn(100)

# Compute root mean squared error
rmse = verif.metric.Rmse()
value = rmse._computeObsFcst(obs, fcst)

@brey
Copy link
Author

brey commented Oct 17, 2016

Hi tnipen, thanks for your response. I am currently working on hydrodynamic simulations with meteo data as forcing and I am almost ready to start doing some validation with measurements when I found verif. I think that the command line feature is very useful since we indent to go operational with a script. However for prototyping and possibly also in operational mode I use python and a module functionality is preferable.

I looked into the code a bit and I came up with a Notebook that can be used as a base for an addition to your repository. You can find it here https://gist.github.com/brey/ac19d887fb43484513d59e7a41aab30e

Cheers,

George

@tnipen
Copy link
Contributor

tnipen commented Oct 23, 2016

That's a pretty clever approach, I hadn't thought of using verif like that. I like it. I think I will implement a few things to make this easier:

  • The ability to read data files directly from URLs, not just local filenames.
  • An interface to Data that allows you to assemble the data inside the python session, instead of
    having to write the data to file and then read it in again.

Stay tuned and let me know if you have any other ideas.

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