Comments (6)
It should work with version 2022.3.0.
from fastscape.
Hi Jean,
Thanks for the report.
It looks like xarray-simlab needs to be updated in order to be fully compatible with the last version(s) of Xarray. Which version of Xarray do you use (i.e., output of xr.__versions__
)? I could reproduce the issue with version 2022.12.0. I guess Xarray has been updated as well when updating your environment.
In the meantime, for your example here is a workaround (working with Xarray version 2022.12.0):
with basic_model, xs.monitoring.ProgressBar():
ds_out = (
ds_in
.stack(batch=['U','K'])
.drop_indexes(["batch", "U", "K"]) # explicitly drop the multi-index
.drop_vars("batch") # remove the batch dimension coordinate
.xsimlab.run(
check_dims='transpose',
store=zgroup,
batch_dim='batch',
parallel=True,
scheduler='processes',
)
.set_index(batch=["U", "K"]) # explicitly set the multi-index
.unstack("batch")
)
Alternatively, you could define dimensions that corresponds to the parameter variables (so that you can use those parameter values as Xarray coordinates!):
ds_in = xs.create_setup(
input_vars={
'uplift__rate': ('uplift__rate', [1e-4,1e-3]),
'spl__k_coef': ('spl__k_coef', [1e-6,1e-5]),
...
},
)
And then
with basic_model, xs.monitoring.ProgressBar():
ds_out = (
ds_in
.stack(batch=['uplift__rate', 'spl__k_coef'], create_index=False) # do not create an index
.xsimlab.run(
check_dims='transpose',
store=zgroup,
batch_dim='batch',
parallel=True,
scheduler='processes',
)
.set_index(batch=["uplift__rate", "spl__k_coef"]) # explicitly set the multi-index
.unstack("batch")
)
from fastscape.
Hello @benbovy . Thanks. I have version 2022.12.0 too. I'll use your workaround. Can I get it to work if I downgrade array? To which version?
from fastscape.
Thanks
from fastscape.
Re-opening as we should make it work with last versions of Xarray.
from fastscape.
Closing as this should be fixed upstream: xarray-contrib/xarray-simlab#193
from fastscape.
Related Issues (18)
- Landlab bridge
- Causes of slower execution compared to fatscapelib-fortran low-level API
- Add xsimlab process for steady-state moutain initial topography
- Split the marine transport / deposition process into several ones
- Check that all array dtypes match with those defined in fortran
- FlowAccumulator process missing in docs (API) HOT 2
- Proper initialization of out variables everywhere?
- Error in demo enviroment HOT 10
- Xarray-simlab 0.4 related updates
- using the C++ library HOT 1
- Problem with bc HOT 2
- grid__area computed value is wrong
- FlowAccumulator: add an area on-demand variable
- Issue installing fastscape HOT 2
- Marine component inconsistent parameters
- numpy.int in flow.py HOT 1
- How to add my DEM data to simulate the evolution process? HOT 2
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 fastscape.