Comments (21)
v0.8.1 was released and that should have dealt with this issue; I'm closing it in favour of #132
from geophysicalflows.jl.
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.
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.
@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.
Oh my. The Manifest.toml
in the examples is extremely outdated.
Ok, it's on users to keep this updated.
from geophysicalflows.jl.
@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:
- Navigate to the root directory, eg
/GeophysicalFlows.jl/
. - Type
git checkout master; git pull
. - Open julia with the project's environment:
julia --project
. - Within julia, update the
Manifest.toml
file by typingjulia> using Pkg; Pkg.update()
. - Now try running the example by typing
julia> include("examples/barotropicqg_betadecay.jl")
.
This sequence of steps worked for me.
from geophysicalflows.jl.
I'll streamline the process!
Thanks @francispoulin for pointing this out.
from geophysicalflows.jl.
@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.
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.
Maybe I should have said that the following command, which didn't work before, does work now.
import GeophysicalFlows.BarotropicQG
from geophysicalflows.jl.
Could you print the output of
using Pkg; Pkg.status()
from geophysicalflows.jl.
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.
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.
An "easy" fix for now is to do
add GeophysicalFlows#master
until I make a new release. Sorry for that :)
from geophysicalflows.jl.
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.
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.
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.
(Perhaps, some of the confusions that I may have created about "activated project" can be alleviated via julia's docs...)
from geophysicalflows.jl.
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.
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.
I am happy to help and please ask. I am a novice now so a good target audience.
from geophysicalflows.jl.
Related Issues (20)
- `MultiLayerQG` tests fail on Julia v1.6
- 3D Navier-Stokes HOT 1
- Better docstring for module `Problem` constructors
- Avoid scalar operations every time-step
- Should we enforce dealiasing before any calculation of nonlinear terms? HOT 7
- No need to import `FFTW` in examples
- `Plots` no longer accepts functions as `clims` HOT 7
- MultilayerQG example crashed at about 35000 steps HOT 7
- Optimized PV inversion for two layer case in `MultilayerQG` HOT 4
- Demonstrate save/load output functionality in an example
- Convert diagnostics output for `MultiLayerQG` from Arrays to Tuples? HOT 1
- م
- Potential missing factor in `MultiLayerQG.energies` HOT 1
- construct a random field with prescribed spectral slope HOT 2
- enstrophy and cuda problem HOT 7
- Should we be passing `forcing_spectrum` as argument into `calcF!`? HOT 2
- Option to specify PV gradients explicitly rather than computing them spectrally HOT 4
- Sign error for mean PV gradient `Qy` in `MultiLayerQG` module HOT 11
- Add citations in the Docs via DocumenterCitations.jl
- Mistake in stretching matrix in multilayerqg.jl HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geophysicalflows.jl.