(self, var)
| 152 | return cls(**args) |
| 153 | |
| 154 | def open_store_variable(self, var): |
| 155 | if hasattr(var, "dims"): |
| 156 | dimensions = [ |
| 157 | dim.split("/")[-1] if dim.startswith("/") else dim for dim in var.dims |
| 158 | ] |
| 159 | else: |
| 160 | # GridType does not have a dims attribute - instead get `dimensions` |
| 161 | # see https://github.com/pydap/pydap/issues/485 |
| 162 | dimensions = var.dimensions |
| 163 | if ( |
| 164 | self._protocol == "dap4" |
| 165 | and var.name in dimensions |
| 166 | and hasattr(var, "dataset") # only True for pydap>3.5.5 |
| 167 | ): |
| 168 | var.dataset.enable_batch_mode() |
| 169 | data_array = self._get_data_array(var) |
| 170 | data = indexing.LazilyIndexedArray(data_array) |
| 171 | var.dataset.disable_batch_mode() |
| 172 | else: |
| 173 | # all non-dimension variables |
| 174 | data = indexing.LazilyIndexedArray(PydapArrayWrapper(var)) |
| 175 | |
| 176 | return Variable(dimensions, data, var.attributes) |
| 177 | |
| 178 | def get_variables(self): |
| 179 | # get first all variables arrays, excluding any container type like, |
no test coverage detected