UNR Device

A UNR is an unfilled requirement or position on a project. UNR Device was made with the aim of helping leadership find all possible roles any given person could fill for a project. Currently reports all personnel in a given department but could be theoretically updated to return specific people.

Usage

Technical Explanation

This program requires a csv file from Clarity as input and leverages MITREs proprietary mii python module. It outputs an excel workbook for each person in a department with UNRs they can work. The tool assumes you can work on things that are 1 step above your “level”. Each workbook has 3 tabs:

Taking the form of a python command line tool, the structure of the source code will be made up of a main() function that is called to be executed on the last step of the program.

#!/usr/bin/env python

from mii import ActivePeople as ap
import pandas as pd
import os
import xlsxwriter

After the python shebang and imports, we define a that will be used along an axis (or column) on the dataframe.

def integerizer(step):
    if isinstance(step, str):
        step = int(step[0])
    return step

Now we define main() by first importing clarity’s list of UNRS and then sanitizing the input by renaming, reording, and dropping some projects/columns.

def main():
    df = pd.read_csv("<csv from clarity>", header=1)
    
    # clean/reorganize file
    df = df[df["Type"] != 'Idea'] 
    df.drop('team_____internalid', axis=1, inplace=True)
    df.rename(columns={'oldName': 'newName'...}, inplace=True) 
    # reorder columns to have date first
    df = df[["Last Updated Date", "MITRE Number", "Last Updated By", "Project Leader", "Project Name"...]]
    # sort df by date descending (most recent first)
    df.sort_values(by=["Last Updated Date"], inplace=True, ascending=False)

Now we have to pull the list of employees using the proprietary python module, and align/translate a value to connect this data set with Claritys:

    dept_employees = ap.get_department_employees("P531")
    # align the other dataset's "step" value to allow for numerical comparison
    for employee in dept_employees:
        match employee.job_level:
            case "Associate":
                employee.job_level = 1
            case "Intermediate":
                employee.job_level = 2
            case "Senior":
                employee.job_level = 3
            case "Lead":
                employee.job_level = 4
            case "Principal":
                employee.job_level = 5
            case "Senior Principal":
                employee.job_level = 6
            case "Distinguished":
                employee.job_level = 7
            case _:
                continue

We only need to define this dataframe once since it is not different per-employee:

    no_step_or_clearance = df[(df["clearance"].isna()) & (df["step"].isna())]

lastly we need to loop through every employee in a department and, for each one:

This tool found use in the hands of a few group leaders and department managers that wanted a total set of opportunities for the person they were working with.