Coder Social home page Coder Social logo

Comments (21)

navidcy avatar navidcy commented on June 12, 2024 1

v0.8.1 was released and that should have dealt with this issue; I'm closing it in favour of #132

from geophysicalflows.jl.

glwagner avatar glwagner commented on June 12, 2024

This is example is broken for me too, although the error I get is different than @francispoulin:

~/Projects/GeophysicalFlows.jl/examples$ julia --project
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.2 (2020-09-23)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> include("barotropicqg_betadecay.jl")
ERROR: LoadError: MethodError: no method matching Problem(::CPU; nx=128, Lx=6.283185307179586, β=10.0, μ=0.0, dt=0.05, stepper="FilteredRK4")
Closest candidates are:
  Problem(; nx, Lx, ny, Ly, dt, f0, β, eta, ν, nν, μ, stepper, calcFU, calcFq, stochastic, T, dev) at /Users/gregorywagner/.julia/packages/GeophysicalFlows/i9qG7/src/barotropicqg.jl:34
Stacktrace:
 [1] top-level scope at /Users/gregorywagner/Projects/GeophysicalFlows.jl/examples/barotropicqg_betadecay.jl:45
 [2] include(::String) at ./client.jl:457
 [3] top-level scope at REPL[1]:1
in expression starting at /Users/gregorywagner/Projects/GeophysicalFlows.jl/examples/barotropicqg_betadecay.jl:45

julia> 

from geophysicalflows.jl.

glwagner avatar glwagner commented on June 12, 2024

It's a bit perplexing, because presumably the example is run to generate the documentation. I'm not sure what's happening.

from geophysicalflows.jl.

glwagner avatar glwagner commented on June 12, 2024

@francispoulin your error may arise because you are trying to run the example with a different version of GeophysicalFlows than what you've cloned from github.

Try navigating to examples/ and typing

julia --project

and then

julia> include("barotropicqg_betadecay.jl")

from geophysicalflows.jl.

glwagner avatar glwagner commented on June 12, 2024

Oh my. The Manifest.toml in the examples is extremely outdated.

Ok, it's on users to keep this updated.

from geophysicalflows.jl.

glwagner avatar glwagner commented on June 12, 2024

@francispoulin I think the issue is unfortunately partly due to the fact that we don't provide a Manifest.toml which means that your environment can drift even when you're on the master branch of the git repo.

Let me know if these steps solve it for you:

  1. Navigate to the root directory, eg /GeophysicalFlows.jl/.
  2. Type git checkout master; git pull.
  3. Open julia with the project's environment: julia --project.
  4. Within julia, update the Manifest.toml file by typing julia> using Pkg; Pkg.update().
  5. Now try running the example by typing julia> include("examples/barotropicqg_betadecay.jl").

This sequence of steps worked for me.

from geophysicalflows.jl.

navidcy avatar navidcy commented on June 12, 2024

I'll streamline the process!
Thanks @francispoulin for pointing this out.

from geophysicalflows.jl.

navidcy avatar navidcy commented on June 12, 2024

@glwagner, did you follow what the examples Readme suggests?

Perhaps we should update that also + add some basic instructions in the Docs.

from geophysicalflows.jl.

francispoulin avatar francispoulin commented on June 12, 2024

Thanks for all the feedback.

First, I did go to examples and try julia --project and then the inclue but that gave the same error.

Second, I verified I was on master and pulled. No changes. The updating worked fine and including command does work without any error. And the annimation works great! Unfortunately, I can't view ti using vlc but mplayer works fine in ubuntu.

Also, when I try the first commands in the script, which failed before, they work fine now.

Do I gather that the problem was that my package was not update date? If I was supposed to udpate something, sorry for not trying that before.

I will keep this open in case you two feel like something needs to be modified. But if you like I'm happy to close it.

from geophysicalflows.jl.

francispoulin avatar francispoulin commented on June 12, 2024

Maybe I should have said that the following command, which didn't work before, does work now.

import GeophysicalFlows.BarotropicQG

from geophysicalflows.jl.

navidcy avatar navidcy commented on June 12, 2024

Could you print the output of

using Pkg; Pkg.status()

from geophysicalflows.jl.

francispoulin avatar francispoulin commented on June 12, 2024

Sure thing:

julia> using Pkg; Pkg.status()
Status `~/.julia/environments/v1.5/Project.toml`
  [7a1cc6ca] FFTW v1.2.4
  [2aec4490] FourierFlows v0.6.3
  [44ee3b1c] GeophysicalFlows v0.8.0
  [da04e1cc] MPI v0.15.1
  [91a5bcdd] Plots v1.7.3
  [37e2e46d] LinearAlgebra
  [de0858da] Printf
  [9a3f8284] Random

from geophysicalflows.jl.

navidcy avatar navidcy commented on June 12, 2024

The problem was the the BarotropicQG module was importing an old, now deprecated, function from FourierFlows.jl package (named getfieldspecs). I've removed this import but have forgotten to make a new patch release of GeophysicalFlows.jl package. So when you did

] add GeophysicalFlows

you installed the latest released version of GeophysicalFlows and it wasn't working. When you followed @glwagner steps you installed the version on master...

from geophysicalflows.jl.

navidcy avatar navidcy commented on June 12, 2024

An "easy" fix for now is to do

add GeophysicalFlows#master

until I make a new release. Sorry for that :)

from geophysicalflows.jl.

francispoulin avatar francispoulin commented on June 12, 2024

Ah, I guess adding what you suggest above is a good fix for now.

When I know it's been fixed I will add the regular version without #master.

from geophysicalflows.jl.

francispoulin avatar francispoulin commented on June 12, 2024

I tried removing the old package and then adding the master version and both have an Error.

(GeophysicalFlows) pkg> remove GeophysicalFlows
ERROR: The following package names could not be resolved:
 * GeophysicalFlows (not found in project or manifest)


(GeophysicalFlows) pkg> add GeophysicalFlows#master
   Updating git-repo `https://github.com/FourierFlows/GeophysicalFlows.jl.git`
ERROR: package `GeophysicalFlows [44ee3b1c]` has same name or UUID as the active project

from geophysicalflows.jl.

navidcy avatar navidcy commented on June 12, 2024

Seems you have activated the repo's project now. I guess you started julia with julia --project from the your GeophysicalFlows.jl local repo folde. Notice that

(GeophysicalFlows) pkg>

So in that case, the GeophysicalFlows will be the version in the local repo you cloned.

Boy... it's not as easy as I would have thought for people to run the examples :(

from geophysicalflows.jl.

navidcy avatar navidcy commented on June 12, 2024

(Perhaps, some of the confusions that I may have created about "activated project" can be alleviated via julia's docs...)

from geophysicalflows.jl.

francispoulin avatar francispoulin commented on June 12, 2024

Thanks for the link @navidcy . That was helpful.

I'm used to using virtual environments in python, and I guess I created one without realizing it. Good to know.

I left Julia, re-entered and saw that I was in the (@v1.5) so I guess I am in a "normal" environment now, not virtual.

I then managed to rm GeophysicalFlows, even though I might not have had to, and then added GeophysicalFlows#master, as suggested. That worked.

Then, I coudl import GeophysicalFlows.BarotropicQG, without a problem

That was a bit of a steap learning curve but I am glad to have learned it and hope not to make that mistake again. But will certainly make others.

from geophysicalflows.jl.

navidcy avatar navidcy commented on June 12, 2024

I'll try to add some more clarifications in the docs and I may ping you to give me your opinion whether they are clearer :)

from geophysicalflows.jl.

francispoulin avatar francispoulin commented on June 12, 2024

I am happy to help and please ask. I am a novice now so a good target audience.

from geophysicalflows.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.