Ouranosinc / PAVICS-landing

The landing page serving as the entrance to PAVICS
1 stars 0 forks source link

nb 5: refresh again to fix Jenkins error #51

Closed tlvu closed 1 year ago

tlvu commented 1 year ago

Wanted a PR instead of pushing to the other refresh notebook PR because I used the cached data in https://github.com/Ouranosinc/PAVICS-landing/blob/master/content/notebooks/climate_indicators/output.zip to refresh this notebook. Is the data still okay?

  _ PAVICS-landing-refresh_notebooks/content/notebooks/climate_indicators/PAVICStutorial_ClimateDataAnalysis-5Visualization.ipynb::Cell 2 _
  Notebook cell execution failed
  Cell 2: Cell outputs differ

  Input:
  import geopandas as gpd
  import hvplot.pandas

  gdf = gpd.GeoDataFrame.from_file(
      "/notebook_dir/pavics-homepage/tutorial_data/gaspesie_mrc.geojson"
  )
  gdf = gdf.dissolve(by="MUS_NM_MRC")
  gdf["region_name"] = gdf.index

  # TODO replace with clisops average.average_shape() once it can do a 'skipna'
  # mask of valid (non-nan) data cells
  data_mask = (
      ds_ens.tx_mean.isel(rcp=0, realization=0).mean(dim=["year", "season"]).notnull()
  )
  # spatial weights of gridcells interesecting each polygon
  weight_masks = subset.create_weight_masks(ds_ens, poly=gdf)

  def clean_masks(data_mask, masks):
      # remove weight values of gridcells that are nan in the actual data. Rescale so total == 1
      return (masks * data_mask) / (masks * data_mask).sum(dim=["lat", "lon"])

  weight_masks = clean_masks(data_mask, weight_masks)

  # Calculate weighted average for each region
  with xr.set_options(keep_attrs=True):
      reg_ts_sims = (ds_ens * weight_masks).sum(dim=["lat", "lon"])
      reg_ts = xens.ensemble_percentiles(reg_ts_sims)
  reg_ts.load()

  # get only tx_mean percentile variables for this plot
  vars1 = [v for v in reg_ts if "tx_mean" in v]
  # plot a simple map of the sub-regions
  display(
      gdf.hvplot(
          geo=True,
          color="region_name",
          tiles="EsriImagery",
          legend=False,
          frame_width=400,
      )
  )
  # Interative time-series plot of regional means
  reg_ts[vars1].hvplot.line(
      x="year", title="time series of regional mean conditions"
  ).opts(legend_position="top_left", frame_width=500)

  Traceback:
  Missing output fields from running code: {'stderr'}
review-notebook-app[bot] commented 1 year ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

review-notebook-app[bot] commented 1 year ago

View / edit / reply to this conversation on ReviewNB

tlvu commented on 2022-11-28T23:22:41Z ----------------------------------------------------------------

looks like the cached output.zip has 35 attributes, vs 34? Is that expected?


review-notebook-app[bot] commented 1 year ago

View / edit / reply to this conversation on ReviewNB

tlvu commented on 2022-11-28T23:22:42Z ----------------------------------------------------------------

Oh, it's the same stderr tripping Jenkins again

hwloc/linux: Ignoring PCI device with non-16bit domain. 
Pass --enable-32bits-pci-domain to configure to support such devices 
(warning: it would break the library ABI, don't enable unless really needed). 


tlogan2000 commented 1 year ago

I'll try to update the output.zip with refreshed output files