home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

2 rows where issue = 213004586 and user = 4160723 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

user 1

  • benbovy · 2 ✖

issue 1

  • `xarray.core.variable.as_variable()` part of the public API? · 2 ✖

author_association 1

  • MEMBER 2
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
285425155 https://github.com/pydata/xarray/issues/1303#issuecomment-285425155 https://api.github.com/repos/pydata/xarray/issues/1303 MDEyOklzc3VlQ29tbWVudDI4NTQyNTE1NQ== benbovy 4160723 2017-03-09T17:44:09Z 2017-03-09T17:44:09Z MEMBER

Thanks for the link @rabernat!

climlab looks very nice and actually very close to what I'm trying to do with landscape evolution modeling (just prototyping at the moment, no repository on GH yet).

What I want to do is something that is a bit more deeply integrated with xarray than what you suggest for climlab. The basic idea is that a parameter of a model (i.e., a climlab.Process) can be either a scalar, an array-like with space and/or time dimensions and/or even its own dimension (useful for exploring a parameter space), or a function (callable) of other model parameters/inputs/state variables (it this case it is also an output which inherits the dimensions from the other variables used for its computation). I think that a lot of logic implemented in xarray can be reused for handling this.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `xarray.core.variable.as_variable()` part of the public API? 213004586
285363937 https://github.com/pydata/xarray/issues/1303#issuecomment-285363937 https://api.github.com/repos/pydata/xarray/issues/1303 MDEyOklzc3VlQ29tbWVudDI4NTM2MzkzNw== benbovy 4160723 2017-03-09T14:22:33Z 2017-03-09T14:29:28Z MEMBER

mmh not sure if a custom datastore would be most appropriate for my problem, which actually is not about loading (writing) data of a given format into (from) a Dataset.

Ultimately, what I'm trying to do is implementing an API for creating numerical model components, which is heavily inspired from Django ORM (i.e., how models and fields are defined), and use the xarray data structures as an interface.

Let me show a more detailed (though still very incomplete) example of how it would look like:

```python class Parameter(object): def init(self, default=None, allowed_values=None, exclude_dims=None, include_dims=None, bounds=(None, None), attrs=None): # ...

def to_variable(self, obj):
    return xr.as_variable(obj)
    # ... some validation logic

class Model(object): def init(**params): # ...

def to_dataset(self):
    # ...

def run(self, ds):
    # ... run simulation for this model

class StreamPower(Model): k = Parameter(default=7e-5, bounds=(0., None), attrs={'units': 'm**2/y'}) m = Parameter(default=0.4) n = Parameter(default=1)

class Meta:
    short_name = 'spow'

```

```python

model = StreamPower(k=('time', [7e-5, 8e-5, 10e-5]), m=0.5) ds = model.to_dataset() ds <xarray.Dataset> Dimensions: (time: 3) Dimensions without coordinates: time Data variables: spow__k (time) float64 7e-05 8e-05 0.0001 spow__m float64 0.5 spow__n int64 1 ds.spow__k <xarray.DataArray 'spow__k' (time: 3)> array([ 7.000000e-05, 8.000000e-05, 1.000000e-04]) Dimensions without coordinates: time Attributes: units: m**2/y ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  `xarray.core.variable.as_variable()` part of the public API? 213004586

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 33.234ms · About: xarray-datasette