Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: clean up issue tempalates #1331

Merged
merged 6 commits into from
Jun 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/ISSUE_TEMPLATE/blank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
name: Blank Issue
about: Create an issue without a template
---
31 changes: 3 additions & 28 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug", "triage"]
labels: ["bug"]
assignees:
- octocat
- wd15
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: input
id: contact
attributes:
label: Contact Details
description: How can we get in touch with you if we need more info?
placeholder: ex. [email protected]
validations:
required: false
- type: textarea
id: what-happened
attributes:
Expand All @@ -26,16 +18,6 @@ body:
value: "A bug happened!"
validations:
required: true
- type: dropdown
id: version
attributes:
label: Version
description: What version of our software are you running?
options:
- 1.0.2 (Default)
- 1.0.3 (Edge)
validations:
required: true
- type: dropdown
id: browsers
attributes:
Expand All @@ -46,17 +28,10 @@ body:
- Chrome
- Safari
- Microsoft Edge
- N/A
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
- type: checkboxes
id: terms
attributes:
label: Code of Conduct
description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com)
options:
- label: I agree to follow this project's Code of Conduct
required: true
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: Feature Request
description: Suggest an idea to help improve PFHub
title: "[Feature]: "
labels: "enhancement"

body:
- type: markdown
attributes:
value: |
**Thanks for taking the time to fill out this feature request
report!** We kindly ask that you search to see if an issue
[already exists](https://github.com/usnistgov/pfhub/issues)
for your feature.

We are also happy to accept contributions from our users. For
more details see
[here](https://github.com/usnistgov/pfhub/blob/master/DEVELOPMENT.md).

- type: textarea
attributes:
label: Description
description: |
A clear and concise description of the feature you're interested in.
validations:
required: true

- type: textarea
attributes:
label: Suggested Solution
description: |
Describe the solution you'd like. A clear and concise description of what you want to happen.
validations:
required: true

- type: textarea
attributes:
label: Alternatives
description: |
Describe alternatives you've considered.
A clear and concise description of any alternative solutions or features you've considered.
validations:
required: false

- type: textarea
attributes:
label: Additional Context
description: |
Add any other context about the problem here.
validations:
required: false
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/web_bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug"]
assignees:
- wd15
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: dropdown
id: browsers
attributes:
label: What browsers are you seeing the problem on?
multiple: true
options:
- Firefox
- Chrome
- Safari
- Microsoft Edge
- N/A
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ script:
";
- nix-shell _apps/data/shell.nix --pure --command "
cd _apps/data &&
#py.test test.py &&
black --check *.py &&
pylint *.py &&
flake8 *.py
Expand Down
28 changes: 24 additions & 4 deletions _data/python-pfhub/pfhub/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import yaml


def make_yaml_content(id_, version):
def make_yaml_content(id_, version, name=None):
"""Generate some test yaml content

Args:
Expand All @@ -15,7 +15,7 @@ def make_yaml_content(id_, version):
Returns:
yaml result content as string
"""
return f"""
data = f"""
---
benchmark:
id: {id_}
Expand Down Expand Up @@ -45,24 +45,30 @@ def make_yaml_content(id_, version):
expr: datum.y * 2
as: b
"""
if name is not None:
data = data + f"\nname: {name}"
return data


def make_yaml(dir_, name, id_, version):
def make_yaml(dir_, name, id_, version, add_name=False):
"""Generate a yaml file for test purposes

Args:
dir_: the result directory to write to
name: name of the result
id_: the benchmark id_ (e.g. "8a")
version: the version (e.g. "1")
name: the name of the simulation (e.g. "fipy1a")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"name" is defined twice. "add_name" is a bool.


Returns:
name of the file created
"""
dir_name = dir_ / name
dir_name.mkdir(exist_ok=True)
yaml_file = dir_name / "meta.yaml"
yaml_file.write_text(make_yaml_content(id_, version))
yaml_file.write_text(
make_yaml_content(id_, version, name=name if add_name else None)
)
return yaml_file


Expand All @@ -80,6 +86,20 @@ def yaml_data_file(tmp_path):
return make_yaml(tmp_path, "result", "1a", 1)


@pytest.fixture
def yaml_data_file_with_name(tmp_path):
"""Generate a yaml test file with name included

Args:
tmp_path: temporary area to use to write files

Returns:
name of the data file
"""
tmp_path.mkdir(exist_ok=True)
return make_yaml(tmp_path, "result1", "1a", 1, add_name=True)


@pytest.fixture
def test_data_path(tmp_path):
"""Generate two result data files
Expand Down
25 changes: 13 additions & 12 deletions _data/python-pfhub/pfhub/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,20 @@ def read_add_name(yaml_url):

>>> assert read_add_name(getfixture('yaml_data_file').as_uri())['name'] == 'result'

>>> assert read_add_name(
... getfixture('yaml_data_file_with_name'
... ).as_uri())['name'] == 'result1'

"""
data = read_yaml_from_url(yaml_url)
if 'name' in data:
if "name" in data:
return data
else:
return assoc(
read_yaml_from_url(yaml_url),
"name",
os.path.split(os.path.split(yaml_url)[0])[1],
)

return assoc(
read_yaml_from_url(yaml_url),
"name",
os.path.split(os.path.split(yaml_url)[0])[1],
)


def maybe(func):
Expand Down Expand Up @@ -210,9 +214,7 @@ def concat_items(items):

"""
concat = lambda x: pandas.concat(x) if x != [] else None
return pipe(
items, map_(lambda x: assign(x[0], x[1])), compact, list, concat
)
return pipe(items, map_(lambda x: assign(x[0], x[1])), compact, list, concat)


@curry
Expand Down Expand Up @@ -573,12 +575,11 @@ def read_vega_data(keys, data):

read_values = sequence(get("values"), pandas.DataFrame)


return pipe(
data,
read_url if "url" in data else read_values,
apply_transforms(data),
maybe(lambda x: get(keys, x))
maybe(lambda x: get(keys, x)),
)


Expand Down