Skip to content

Commit

Permalink
Merge pull request #1060 from sbillinge/reports
Browse files Browse the repository at this point in the history
reports
  • Loading branch information
sbillinge authored Mar 24, 2024
2 parents 2bc834d + 96d2884 commit 2448bb6
Show file tree
Hide file tree
Showing 21 changed files with 4,457 additions and 3,962 deletions.
1 change: 1 addition & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
run: |
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda activate test
conda install --file requirements/run.txt
conda install --file requirements/test.txt
pip install -r requirements/pip.txt
Expand Down
2 changes: 1 addition & 1 deletion news/TEMPLATE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@

**Security:**

* <news item>
* <news item>
23 changes: 23 additions & 0 deletions news/reports.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* In annual activity, grants are automatically considered as projects unless specified otherwise

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
2 changes: 1 addition & 1 deletion regolith/builders/activitylogbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def latex(self):
)
#remove unpublished papers
# unpubs = [pub for pub in pubs if len(pub.get("doi") == 0)]
pubed = [pub for pub in pubs if len(pub.get("doi")) > 0]
pubed = [pub for pub in pubs if len(pub.get("doi","")) > 0]
non_arts = [pub for pub in pubs if pub.get("entrytype") != "article"]
pubs = pubed + non_arts
bibfile = make_bibtex_file(
Expand Down
6 changes: 3 additions & 3 deletions regolith/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,13 @@ def get_dates(thing, date_field_prefix=None):
thing["end_day"] = last_day(thing["end_year"], thing["end_month"])
end_date = datetime.date(thing["end_year"],month_to_int(thing["end_month"]),
thing["end_day"])
if thing.get(datenames[2]):
if not thing.get(datenames[1]):
if thing.get(datenames[2]): # prefix_year
if not thing.get(datenames[1]): # prefix_month
if thing.get("begin_year"):
print(f"WARNING: both year and begin_year specified in {thing.get('_id', '(no id)')}. Year info will be used")
begin_date = datetime.date(thing[datenames[2]],1,1)
end_date = datetime.date(thing[datenames[2]],12,31)
elif not thing.get(datenames[0]):
elif not thing.get(datenames[0]): # prfix_day
if thing.get("begin_year"):
print(f"WARNING: both year and begin_year specified in {thing.get('_id', '(no id)')}. Year info will be used")
begin_date = datetime.date(thing[datenames[2]],month_to_int(thing[datenames[1]]),
Expand Down
5 changes: 4 additions & 1 deletion regolith/helpers/a_expensehelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from regolith.helpers.basehelper import DbHelperBase
from regolith.fsclient import _id_key
from regolith.schemas import EXPENSES_STATI, EXPENSES_TYPES
from regolith.schemas import alloweds
from regolith.tools import (
all_docs_from_collection,
get_pi_id,
Expand All @@ -15,6 +15,9 @@

TARGET_COLL = "expenses"

EXPENSES_STATI = alloweds.get("EXPENSES_STATI")
EXPENSES_TYPES = alloweds.get("EXPENSES_TYPES")

def expense_constructor(key, begin_date, end_date, rc):
'''
constructs a document with default fields for an expense
Expand Down
7 changes: 3 additions & 4 deletions regolith/helpers/a_presentationhelper.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
"""Helper for adding a presentation to the presentation collection.
"""
import urllib
from sys import stderr
import time

import dateutil.parser as date_parser
import threading
from warnings import warn

from regolith.helpers.a_expensehelper import expense_constructor
from regolith.helpers.basehelper import DbHelperBase
from regolith.fsclient import _id_key
from regolith.schemas import PRESENTATION_TYPES, PRESENTATION_STATI
from regolith.schemas import alloweds
from regolith.tools import (
all_docs_from_collection,
get_pi_id,
Expand All @@ -24,6 +21,8 @@
TARGET_COLL = "presentations"
EXPENSES_COLL = "expenses"

PRESENTATION_TYPES = alloweds.get("PRESENTATION_TYPES")
PRESENTATION_STATI = alloweds.get("PRESENTATION_STATI")

def subparser(subpi):
date_kwargs = {}
Expand Down
2 changes: 1 addition & 1 deletion regolith/helpers/a_projectumhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
all_docs_from_collection,
get_pi_id, get_uuid,
)
from regolith.schemas import MILESTONE_TYPES
# from regolith.schemas import MILESTONE_TYPES

from gooey import GooeyParser

Expand Down
3 changes: 2 additions & 1 deletion regolith/helpers/l_milestoneshelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
key_value_pair_filter,
collection_str
)
from regolith.schemas import PROJECTUM_STATI, PROJECTUM_PAUSED_STATI, \
from regolith.schemas import alloweds, PROJECTUM_PAUSED_STATI, \
PROJECTUM_CANCELLED_STATI, PROJECTUM_FINISHED_STATI, PROJECTUM_ACTIVE_STATI
from gooey import GooeyParser

PROJECTUM_STATI = alloweds.get("PROJECTUM_STATI")
TARGET_COLL = "projecta"
HELPER_TARGET = "l_milestones"
PROJECTUM_STATI.append("all")
Expand Down
5 changes: 3 additions & 2 deletions regolith/helpers/l_progressreporthelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
get_pi_id,
key_value_pair_filter,
)
from regolith.schemas import PROJECTUM_STATI, PROJECTUM_ACTIVE_STATI, PROJECTUM_FINISHED_STATI
from regolith.schemas import alloweds, PROJECTUM_ACTIVE_STATI, PROJECTUM_FINISHED_STATI

TARGET_COLL = "projecta"
HELPER_TARGET = "l_progress"

PROJECTUM_STATI = alloweds.get("PROJECTUM_STATI")

def subparser(subpi):
listbox_kwargs = {}
if isinstance(subpi, GooeyParser):
Expand Down Expand Up @@ -178,4 +180,3 @@ def sout(self):
self.print_projectum(proposedp)
print(f"*************************[In Progress Projecta]*************************")
self.print_projectum(startedp)

8 changes: 3 additions & 5 deletions regolith/helpers/l_todohelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@
import dateutil.parser as date_parser
import math

from regolith.dates import get_due_date
from regolith.helpers.basehelper import SoutHelperBase
from regolith.fsclient import _id_key
from regolith.schemas import (
TODO_STATI,
PROJECTUM_ACTIVE_STATI
)
from regolith.schemas import alloweds, PROJECTUM_ACTIVE_STATI
from regolith.tools import (
all_docs_from_collection,
get_pi_id,
Expand All @@ -28,6 +24,8 @@
-2] # eisenhower matrix (important|urgent) tt=3, tf=2, ft=1, ff=0
STATI = ["accepted", "downloaded", "inprep"]

TODO_STATI = alloweds.get("TODO_STATI")

def subparser(subpi):
listbox_kwargs = {}
date_kwargs = {}
Expand Down
2 changes: 1 addition & 1 deletion regolith/helpers/makeappointmentshelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from datetime import timedelta, date

from regolith.helpers.basehelper import SoutHelperBase
from regolith.schemas import APPOINTMENTS_TYPES
# from regolith.schemas import APPOINTMENTS_TYPES
from regolith.fsclient import _id_key
from regolith.tools import (
all_docs_from_collection,
Expand Down
9 changes: 3 additions & 6 deletions regolith/helpers/u_milestonehelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
It can add a new milestone to the projecta collection.
"""
from copy import deepcopy
from itertools import chain
import datetime as dt
import dateutil.parser as date_parser
from gooey import GooeyParser
Expand All @@ -13,13 +12,12 @@
from regolith.tools import all_docs_from_collection, fragment_retrieval, \
get_uuid
from regolith.dates import get_due_date
from regolith.schemas import PROJECTUM_ACTIVE_STATI, \
MILESTONE_TYPES, PROJECTUM_STATI
from regolith.schemas import alloweds


TARGET_COLL = "projecta"
MILESTONE_TYPES = MILESTONE_TYPES
PROJECTUM_STATI = PROJECTUM_STATI
MILESTONE_TYPES = alloweds.get("MILESTONE_TYPES")
PROJECTUM_STATI = alloweds.get("PROJECTUM_STATI")


def subparser(subpi):
Expand Down Expand Up @@ -282,4 +280,3 @@ def db_updater(self):
print(f"Multiple ids match your milestone_uuid entry ({multiple[0]}).\n"
"Try entering more characters of the uuid and rerun the helper.\n")
return

3 changes: 2 additions & 1 deletion regolith/helpers/u_todohelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from regolith.helpers.basehelper import DbHelperBase
from regolith.fsclient import _id_key
from regolith.schemas import (TODO_STATI, PROJECTUM_ACTIVE_STATI)
from regolith.schemas import alloweds, PROJECTUM_ACTIVE_STATI
from regolith.tools import (
all_docs_from_collection,
get_pi_id,
Expand All @@ -23,6 +23,7 @@
TARGET_COLL = "todos"
ALLOWED_IMPORTANCE = [3, 2, 1, 0]

TODO_STATI = alloweds.get("TODO_STATI")
def subparser(subpi):
deci_kwargs = {}
notes_kwargs = {}
Expand Down
Loading

0 comments on commit 2448bb6

Please sign in to comment.