This provides a centralized method to set the variables on the data store. Parameters ---------- variables : dict-like Dictionary of key/value (variable name / xr.Variable) pairs check_encoding_set : list-like List of variable
(self, variables, check_encoding_set, writer, unlimited_dims=None)
| 552 | self.set_attribute(k, v) |
| 553 | |
| 554 | def set_variables(self, variables, check_encoding_set, writer, unlimited_dims=None): |
| 555 | """ |
| 556 | This provides a centralized method to set the variables on the data |
| 557 | store. |
| 558 | |
| 559 | Parameters |
| 560 | ---------- |
| 561 | variables : dict-like |
| 562 | Dictionary of key/value (variable name / xr.Variable) pairs |
| 563 | check_encoding_set : list-like |
| 564 | List of variables that should be checked for invalid encoding |
| 565 | values |
| 566 | writer : ArrayWriter |
| 567 | unlimited_dims : list-like |
| 568 | List of dimension names that should be treated as unlimited |
| 569 | dimensions. |
| 570 | """ |
| 571 | |
| 572 | for vn, v in variables.items(): |
| 573 | name = _encode_variable_name(vn) |
| 574 | check = vn in check_encoding_set |
| 575 | target, source = self.prepare_variable( |
| 576 | name, v, check, unlimited_dims=unlimited_dims |
| 577 | ) |
| 578 | |
| 579 | writer.add(source, target) |
| 580 | |
| 581 | def set_dimensions(self, variables, unlimited_dims=None): |
| 582 | """ |
no test coverage detected