Skip to content

Commit bae32c4

Browse files
committed
Add instructions on posting dataset metadata
1 parent eada2ff commit bae32c4

File tree

4 files changed

+75
-2
lines changed

4 files changed

+75
-2
lines changed

.github/ISSUE_TEMPLATE/01_feature.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ body:
2121
Provide a clear and concise description of what the problem is. For example:
2222
- "I'm trying to simulate particle behavior with [specific physics], but Parcels doesn't support..."
2323
- "When working with [specific data format/kernel], I find it difficult to..."
24+
25+
If you would like to see Parcels work with a specific dataset, please also [follow our instructions on how to share dataset metadata](https://docs.oceanparcels.org/en/v4-dev/development/posting-issues.html).
2426
validations:
2527
required: true
2628
- type: textarea

.github/ISSUE_TEMPLATE/02_bug.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ body:
1717
- type: "textarea"
1818
attributes:
1919
label: "Code sample"
20-
description: "If relevant, please provide a code example where this bug is shown as well as any error message. A [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) is preffered as it makes it much easier for developers to identify the cause of the bug. This also allows them quickly determine whether the problem is with your code or with Parcels itself."
20+
description: "If relevant, please provide a code example where this bug is shown as well as any error message. A [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) is preffered as it makes it much easier for developers to identify the cause of the bug. This also allows them quickly determine whether the problem is with your code or with Parcels itself. If you want support on a specific dataset, please [follow our instructions on how to share dataset metadata](https://docs.oceanparcels.org/en/v4-dev/development/posting-issues.html)"
2121
value: |
2222
```python
2323
# Paste your code within this block

docs/development/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Release Notes <https://github.com/Parcels-code/Parcels/releases>
1717
1818
maintainer
1919
docsguide
20+
posting-issues
2021
```
2122

2223
## Why contribute?
@@ -55,7 +56,7 @@ Exactly how to use Git and GitHub is beyond the scope of this documentation, and
5556

5657
There are many ways that you can contribute to Parcels. You can:
5758

58-
- Participate in discussion about Parcels, either through the [issues](https://github.com/Parcels-code/parcels/issues) or [discussions](https://github.com/Parcels-code/parcels/discussions) tab
59+
- Participate in discussion about Parcels, either through the [issues](https://github.com/Parcels-code/parcels/issues) or [discussions](https://github.com/Parcels-code/parcels/discussions) tab. See our guide on [posting-issues](./posting-issues.md).
5960
- Suggest improvements to [tutorials and how-to guides](../user_guide/index.md)
6061
- Suggest improvements to [documentation](../index.md)
6162
- Write code (fix bugs, implement features, codebase improvements, etc)

docs/development/posting-issues.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
file_format: mystnb
3+
kernelspec:
4+
name: python3
5+
---
6+
7+
# Participating in the issue tracker
8+
9+
We love hearing from our community!
10+
We want to be able to support you in your workflows, and learn about how you use Parcels.
11+
In open source projects, getting feedback from users is hard - you posting
12+
issues and participating in the issue tracker is really useful for us and
13+
helps future development and squash bugs.
14+
15+
Parcels provides issue templates for when posting issues.
16+
Following these templates provides structure and ensures that we have all the necessary information we need to help you.
17+
18+
## "Parcels doesn't work with my input dataset"
19+
20+
Parcels is designed to work with a large range of input datasets.
21+
22+
When extending support for various input datasets, or trying to debug problems
23+
that only occur with specific datasets, having the dataset metadata is very valuable.
24+
25+
This metadata could include information such as:
26+
27+
- CF compliant metadata
28+
- descriptions about the origin of the dataset, or additional comments
29+
- the shapes and data types of the arrays
30+
31+
This also allows us to see if your metadata is broken/non-compliant with standards - where we can then suggest fixes for you (and maybe we can tell the data provider!).
32+
Since version 4 of Parcels we rely much more on metadata to discover information about your input data.
33+
34+
Sharing this metadata often provides enough debugging information to solve your problem, instead of having to share a whole dataset.
35+
36+
Sharing dataset metadata is made easy in Parcels.
37+
38+
### Step 1. Users
39+
40+
As a user with access to your dataset, you would do:
41+
42+
```{code-cell}
43+
import json
44+
45+
import xarray as xr
46+
47+
# defining an example dataset to illustrate
48+
# (you would use `xr.open_dataset(...)` instead)
49+
ds = xr.Dataset(attrs={"description": "my dataset"})
50+
51+
output_file = "my_dataset.json"
52+
with open(output_file, "w") as f:
53+
json.dump(ds.to_dict(data=False), f) # write your dataset to a JSON excluding array data
54+
```
55+
56+
Then attach the produced JSON file alongside your issue
57+
58+
### Step 2. Maintainers and developers
59+
60+
As developers looking to inspect the metadata, we would do:
61+
62+
```{code-cell}
63+
from parcels._datasets.utils import from_xarray_dataset_dict
64+
65+
with open(output_file) as f:
66+
d = json.load(f)
67+
ds = from_xarray_dataset_dict(d)
68+
```
69+
70+
From there we can take a look the metadata of your dataset!

0 commit comments

Comments
 (0)