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

Fix E501, F541, and F841 for a_proposalhelper, a_proprevhelper, a_todohelper #1081

Merged
merged 1 commit into from
Jul 4, 2024
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
3 changes: 1 addition & 2 deletions regolith/helpers/a_proposalhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ def construct_global_ctx(self):
gtx["zip"] = zip

def db_updater(self):
gtx = self.gtx
rc = self.rc
if rc.date:
now = date_parser.parse(rc.date).date()
Expand Down Expand Up @@ -168,7 +167,7 @@ def db_updater(self):
):
# assuming that the user inputs the correct duration up to 1 decimal place
# so the maximum allowed difference is 0.1*30.5
raise ValueError(f"ERROR: please rerun specifying a duration OR an end-date but not both")
raise ValueError("ERROR: please rerun specifying a duration OR an end-date but not both")
pdoc.update({"begin_date": begin_date})
else:
pdoc.update({"begin_date": "tbd"})
Expand Down
4 changes: 2 additions & 2 deletions regolith/helpers/a_proprevhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def subparser(subpi):
date_kwargs["widget"] = "DateChooser"

subpi.add_argument("name", help="pi first name space last name in quotes", default=None)
subpi.add_argument("type", choices=ALLOWED_TYPES, help=f"Report type", default=None)
subpi.add_argument("type", choices=ALLOWED_TYPES, help="Report type", default=None)
subpi.add_argument("due_date", help="Due date", **date_kwargs)
subpi.add_argument(
"-d",
Expand All @@ -32,7 +32,7 @@ def subparser(subpi):
)
subpi.add_argument("-q", "--requester", help="Name of the Program officer requesting")
subpi.add_argument("-r", "--reviewer", help="name of the reviewer. Defaults to sbillinge")
subpi.add_argument("-s", "--status", choices=ALLOWED_STATI, help=f"Report status", default="accepted")
subpi.add_argument("-s", "--status", choices=ALLOWED_STATI, help="Report status", default="accepted")
subpi.add_argument("-t", "--title", help="the title of the proposal")
return subpi

Expand Down
16 changes: 9 additions & 7 deletions regolith/helpers/a_todohelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from regolith.fsclient import _id_key
from regolith.tools import all_docs_from_collection, get_pi_id, get_uuid, fragment_retrieval
from gooey import GooeyParser
from sys import exit


TARGET_COLL = "todos"
ALLOWED_IMPORTANCE = [3, 2, 1, 0]
Expand Down Expand Up @@ -41,16 +41,16 @@ def subparser(subpi):
"-d",
"--deadline",
action="store_true",
help=f"specify if the due date (above) has a hard deadline",
help="specify if the due date (above) has a hard deadline",
)
subpi.add_argument(
"-m",
"--importance",
choices=ALLOWED_IMPORTANCE,
type=int,
help=f"The importance of the task. "
f"Corresponds roughly to (3) tt, (2) tf, (1) ft, (0) ff in the Eisenhower matrix of "
f"importance vs. urgency. An important and urgent task would be 3.",
help="The importance of the task. "
"Corresponds roughly to (3) tt, (2) tf, (1) ft, (0) ff in the Eisenhower matrix of "
"importance vs. urgency. An important and urgent task would be 3.",
default=1,
)
subpi.add_argument(
Expand Down Expand Up @@ -92,7 +92,8 @@ def subparser(subpi):
)
subpi.add_argument(
"--date",
help="Enter a date such that the helper can calculate how many days are left from that date to the deadline. Default is today.",
help="Enter a date such that the helper can calculate how many days are left from that date to the deadline. "
"Default is today.",
**date_kwargs,
)

Expand Down Expand Up @@ -216,7 +217,8 @@ def db_updater(self):
mil.update({"tasks": []})
mil["tasks"].append(todo_uuid)
print(
f"The milestone uuid {rc.milestone_uuid} in projectum {target_prum.get('_id')} has been updated in projecta."
f"The milestone uuid {rc.milestone_uuid} in projectum {target_prum.get('_id')} has been "
"updated in projecta."
)
rc.client.update_one(rc.database, "projecta", {"_id": target_prum.get("_id")}, target_prum)
indices = [todo.get("running_index", 0) for todo in todolist]
Expand Down
Loading