Skip to content

Commit

Permalink
Merge pull request #162 from OSeMOSYS/develop
Browse files Browse the repository at this point in the history
Release 1.0.1
  • Loading branch information
trevorb1 authored Apr 20, 2023
2 parents 3c6f04e + 9db90b6 commit dff6852
Show file tree
Hide file tree
Showing 17 changed files with 683 additions and 128 deletions.
89 changes: 89 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Bug Report
description: File a bug report
title: "[Bug]: <Replace with short description of bug>"
labels: ["bug"]
# assignees:
# - trevorb1
body:

- type: textarea
attributes:
label: The Issue
description: A concise description of the issue you are experiencing.
validations:
required: true

- type: textarea
attributes:
label: Expected Behavior
description: A concise description of what you expected to happen.
validations:
required: false

- type: textarea
attributes:
label: Steps To Reproduce
description: How do you trigger this bug? Please walk us through it step by step.
placeholder: |
1. Running this command...
2. With this config.yaml file data...
validations:
required: false

- type: textarea
id: logs
attributes:
label: Log output
description: |
Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
To include the full traceback error, run otoole in verbose mode with the "-v" flag
render: shell
validations:
required: false

- type: dropdown
id: os
attributes:
label: Operating System
description: What operating system are you running?
options:
- Linux
- MacOS
- Windows
validations:
required: true

- type: input
id: version
attributes:
label: What version of otoole are you running?
description: |
To check your version, use the command "otoole -V"
validations:
required: true

- type: textarea
id: solution
attributes:
label: Possible Solution
description: Do you have an idea on how to fix the issue?
validations:
required: false

- type: textarea
id: other
attributes:
label: Anything else?
description: |
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false

# - 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
53 changes: 53 additions & 0 deletions .github/ISSUE_TEMPLATE/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Documentation
description: Issues relating to documentation
title: "[DOCS] <Replace with short description of documentation issue>"
labels: ["documentation"]
body:

- type: dropdown
id: issuetype
attributes:
label: Type of documentation issue.
multiple: true
options:
- Missing Information
- Incorect Information
- Typo
- Other
validations:
required: true

- type: textarea
id: description
attributes:
label: Issue Description
description: Detailed description of the documentation issue.
placeholder: |
ie. There is no description of how to convert from excel files
validations:
required: true

- type: textarea
id: current
attributes:
label: Link to existing documentation
description: If applicable, provide the link to the current documentation location
validations:
required: false

- type: textarea
id: solution
attributes:
label: Suggested Update
description: Do you have an idea on how to update the documention?
validations:
required: false

- type: textarea
id: other
attributes:
label: Additional Info
description: |
Please provide any additional information to help fix this documentation issue.
validations:
required: false
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Feature request
description: Ideas to improve the otoole
title: "[FEATURE] <Replace with short description of feature request>"
labels: ["enhancement"]
body:

- type: textarea
id: request
attributes:
label: Feature Request
description: Detailed description the suggested improvement
validations:
required: true

- type: input
id: bug
attributes:
label: Is your feature related to a bug?
description: If applicable, refer to a an existing bug using the `#bugid` keyword
placeholder: "#bugid 10"
validations:
required: false

- type: textarea
id: solution
attributes:
label: Suggested Solution
description: Do you have an idea on how to implement the idea?
validations:
required: false

- type: textarea
id: other
attributes:
label: Additional Info
description: |
Please provide any additional information or resources that will help us implement the idea.
validations:
required: false
12 changes: 12 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!--- Provide a short description of the pull request -->

### Description
<!--- Describe your changes in detail -->


### Issue Ticket Number
<!--- Link corresponding issue number -->


### Documentation
<!--- Where and how has this change been documented -->
6 changes: 6 additions & 0 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ jobs:
- name: Test with pytest
run: |
tox
- name: Upload coverage data to converalls.io
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install --upgrade coveralls
coveralls --service=github
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ flatten_dict
importlib_resources; python_version<'3.7'
networkx
openpyxl
pandas<2.0
pandas
pydantic
pydot
pyyaml
Expand Down
54 changes: 49 additions & 5 deletions src/otoole/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,20 @@ def __str__(self):
return f"{self.name} -> {self.message}"


class OtooleExcelNameMismatchError(OtooleException):
"""Name mismatch between config and excel tabs."""
class OtooleNameMismatchError(OtooleException):
"""Names not consistent between read in data and config file"""

def __init__(
self, excel_name: str, message: str = "Excel tab name not found in config file"
self,
name: str,
message: str = "Name not consistent between data and config file",
) -> None:
self.excel_name = excel_name
self.name = name
self.message = message
super().__init__(self.message)

def __str__(self):
return f"{self.excel_name} -> {self.message}"
return f"{self.name} -> {self.message}"


class OtooleDeprecationError(OtooleException):
Expand Down Expand Up @@ -126,3 +128,45 @@ def __init__(

def __str__(self):
return f"{self.resource} -> {self.message}"


class OtooleIndexError(OtooleException):
"""Index data not consistent between data and config file
Arguments
---------
resource : str
Name of the resource which is invalid
config_indices: List[str]
Indices from config file
data_indices: List[str]
Indices from input data
"""

def __init__(self, resource, config_indices, data_indices):
self.resource = resource
self.config_indices = config_indices
self.data_indices = data_indices
self.message = "Indices inconsistent between config and data"

def __str__(self):
return f"{self.resource} -> {self.message}. Config indices are {self.config_indices}. Data indices are {self.data_indices}."


class OtooleError(OtooleException):
"""General purpose error
Arguments
---------
resource : str
Name of the resource which is invalid
message : str
Error message
"""

def __init__(self, resource, message):
self.resource = resource
self.message = message

def __str__(self):
return f"{self.resource} -> {self.message}"
Loading

0 comments on commit dff6852

Please sign in to comment.