In TASKRSRC
class, changed data type of target_lag_drtn_hr_cnt
property from int to float. Reference Issue #10
- Added properties to
PROJWBS
class:project
gives PROJWBS objects access to the project and its properties.original_duration
calendar days between start and finish dates.actual_duration
calendar days between the project data date the wbs start date.remaining_duration
calendar days between the wbd finish date and the project data date.
- Added
all_task
property toPROJWBS
class, which returns all tasks assigned to a node and all it's children nodes. - Added
actual_cost
,budgeted_cost
,remaining_cost
, andthis_period_cost
properties toPROJWBS
class. These are sums of the costs for all activities under a WBS node. - Added
start
andfinish
properties toPROJWBS
class. PROJWBS
objects are now sorted by seq_num to match the order reflected in P6.
Node
object now useseq_num
attribute for comparison and sorting.- Fixed potential bug in how children are stored in the
Node
class; switched from a list to a dict to avoid having multiple of the same child.
NOTE: If you have tests setup, this change will require you to delete the existing xer_data.json
fixture and recreate it in the test process.
- Added functionality for traversing
Node
objects:traverse_parents
method iterates through parents to root node.traverse_children
method iterates through all children to leaves.height
property is the length of the longest downward path to a leaf from a given node (leaf nodes with have a height of 0).depth
property is the length of the path to the root node from a given node (root node will have a depth of 0).
- Fixed potential KeyErrors in the
SCHEDOPTIONS
class due to missing attributes in files exported from older versions of P6. Issue #7 - Fixed bug where
create_date
andupdate_date
attributes of theTASK
class may be empty. Issue #8
- Added
tasks
(list[TASK
]) attribute toPROJWBS
class. - Added
task_rsrcs
(list[TASKRSRC
]) attribute toRSRC
class.
Patched potential errors when transformming from a string to a float. Some languages use a comma rather than a period in floating point numbers.
- Added class
RSRCRATE
which represents a Resource Rate. This can be accessed from theresource_rate
(dict) attribute of theXer
object. Issue #6
- Refactored inheritance for
Node
objects.- The
description
attribute of theACTVCODE
andPCATVAL
classes has been changed toname
.
- The
- Fixed bug in the equal override function for the
RSRC
object; missing a return.
- Updated type hints, which now requires a minimum of Python 3.11.
RSRC
class now inherits fromNode
.- Updating / filling in docstrings.
- Updated dependencies to new versions.
ACCOUNT
class equal overide now checks if other object is None type.- The
max_multiple_longest_path
attribute of theSCHEDOPTIONS
class can be type int or None.
- Added
Node
class to represent a Tree data structure - can have one parent and multiple children.ACCOUNT
,ACTVCODE
,PCATVAL
, andPROJWBS
classes now inherit fromNode
class.
- Updated dependency
html-sanitizer
to the latest version2.2.0
- Added
Node
class to represent a Tree data structure - can have one parent and multiple children. ACCOUNT
,ACTVCODE
,PCATVAL
, andPROJWBS
classes now inherit fromNode
class.
- Added
is_wbs
property toTaskType
enum class. Checks if task is a wbs summary type.
- Added
wbs_root
attribute to thePROJECT
class. This is the root WBS node. - Added
children
attribute to thePROJWBS
class. Along with thewbs_root
above, this forms a Tree Data Structure. - Added
children
attribute to theACCOUNT
class. - Added
children
attribute to theACTVCODE
class. - Added
children
attribute to thePCATVAL
class.
- Changed the
PROJECT
name
from an attribute to a property. The project name is stored in thewbs_root
added above.
- The
task_percent
property of thePROJECT
class now ignores Level of Effort activities when calculating percent complete. There were edge cases where the LOE activity had a remaining duration much greater than its original duration, which significantly reduced the calculated percent complete.
- Bug fixes with validating data types for
TASKPRED
objects.
- Bug fixes with validating data types for
TASK
objects.
- Added
resources
attribute containing a list ofTASKRSRC
objects to thePROJECT
class. Previously,TASKRSRC
objects were only accessible through aTASK
object.
Both project specific and global calendars are now included in the PROJECT
calendars
attribute. Covers cases where project tasks are assigned to a gobal calendar.
- Added
actual_duartion
property toPROJECT
class.
Some code cleanup and corrections to the python code in the README file.
- Added function
file_reader
which accepts a .xer file and reads it to a string object.- Accepts str or Path objects for files stored locally or on a server.
- Accepts BinaryIO files from requests, Flask, FastAPI, etc...
- Added classmethods
reader
to theXer
class. A .xer file can be passed directly to this method, which will read and decode the file, and return aXer
object. Uses thefile_reader
function above.
- Changed name of function
xer_to_dict
toparser
.
Updated CorruptXerFile
Exception to receive the list of errors and print them out when the exception is raised. The errors can now be accessed from the Exception when using try
except
.
try:
xer = Xer(file_contents)
except CorruptXerFile as e:
for error in e.errors:
print(error)
Remove error
attribute from xer
class. If the errors are encoutered during initialization of an xer
object, then a CorruptXerFile
Exception is raised.
find_xer_errors
function. Error checking for the file is now its own function that that can find errors in an xer file and povide the results in a list.- Error checking now looks for invalid
rsrc_id
assigned to aTASKRSRC
object.
The option for None type on the following items was originally done to avoid Exceptions being thrown if the file is corrupted. This created additional code to handle situations when the attributes equal None.
- Removed option for
calendar
attribute of theTASK
class to be typeNone
; AllTASK
objects must have acalendar
or theCorruptXerFile
Exception is raised. - Removed option for the
resource
attribute of theTASKRSRC
class to be typeNone
; allTASKRSRC
objects must have aresource
or theCorruptXerFile
Exception is raised.
- Added
actual_total_cost
property toTASKFIN
class - Added
late_start
property toPROJECT
class
TASK
methodrem_hours_per_day
can now accept alate
flag (bool) to calculate late dates rather than early dates.
Refactor / cleanup code. Working on functionality to generate cost loading projections.
- Added
rem_hours_per_day
method toTASK
class. This return a dict with date: workhour key value pairs. This function was originally contained within thecalendar.py
module, but was not being used. Makes more sense to have it as aTASK
method. - Added
base_calendar
attribute toCALENDAR
class. Theis_workday
function will now search thebase_calendar
for holidays when determining if a date is a workday.
remain_drtn_hr_cnt
attribute ofTASK
no longer allowsNone
type.finish
property ofTASK
will now check forreend_date
and return it before it returnsearly_end_date
Added parsing of User Defined Fields (UDF). Issue #4
Expanded testing for more coverage.
Refactor / clean up code for initialization of XER
class.
- Added class
UDFTYPE
which represents a User Defined Field. - Added attribute
user_defined_fields
toPROJECT
,PROJWBS
,RSRC
, andTASK
classes, which hold a dictionary ofUDFTYPE
:UDF Value
key value pairs.
Added parsing of Project Codes. Issue #3.
- Added class
PCATTYPE
which represents a Project Code Type. - Added class
PCATVAL
which represents a Project Code Value. - Added attribute
project_code_types
toXer
class, which holds a dictionary ofPCATTYPE
objects. - Added attribute
project_code_values
toXer
class, which holds a dictionary ofPCATVAL
objects. - Added attribute
project_codes
toPROJECT
class, which holds a dictionary ofPCATTYPE
:PCATVAL
key value pairs assigned to a project.
The ScheduleWarnings
class will no longer be developed under this project. This is a breaking change if you were using the ScheduleWarnings
class.
- Added
__len__
method toCALENDAR
class. Returns number of workdays in a week.
- Removed
warnings.py
from project. This may become a seperate project.
- Added
default_calendar
attribute toPROJECT
class.
- Added
SCHEDOPTIONS
class. - Added
options
attribute thePROJECT
class, which is aSCHEDOPTIONS
object.` - Added
lineage
andfull_code
properties to theACTVCODE
class. Issue #2
- Comparison operators for
ACTVCODE
are now based onfull_code
property rather thancode
property.
Added some additional features noted below, and continue working on Warnings
class.
- Added
lineage
property toPROJWBS
class. Returns list of all ancestorPROJWBS
objects, including self. - Added
duration
property toTASK
class. This will returnremaining_duration
if the task is not started; otherwise, it returnsoriginal_duration
. This is usefull when the remaining duration is unlinked from the original duration in the project settings - in these cases, the remaining duration can be different to the original duration in tasks that have not started.
Fixed bug where the start
property of the TASK
class will return the early finish date rather than early start date if task is not started. Issue #1
- Added docstrings to more classes.
- Improved type validation.
- Added
full_code
property toACCOUNT
class. This property returns the full path to the cost code including any parent codes. This property is now the basis for comparingACCOUNT
objects.
- Small amount of code cleanup and refactoring.
- Added
parent_acct_id
andseq_num
attributes toACCOUNT
class. - Added
parent
property toACCOUNT
class.
- Small amount of refactoring and moving around files.
- Added gt and lt dunder methods to some of the classes.
- Using decorator to round any class method that returns a float. Just playing with decorators, may switch back to rounding directly in the method.
- Removed dependency on
Pydantic
. Speeds up code by ~25%.
- Added testing of
errors
attribute ofXer
class.
- Moved functions
is_workday
,iter_holidays
, anditer_workdays
to be methods of theCALENDAR
class. - The
budgeted_cost
,actual_cost
,this_period_cost
, andremaining_cost
properties of theTASK
class now return float values rounded to two decimal places. Warning: this may cause thePROJECT
level values to be off by .01 from what was previously reported; you will need to recreate test data.
- Removed
has_predecessor
,has_successor
,has_finish_successor
, andhas_start_successor
ofTASK
class. These analyses can be done in the users program.
- Continue working on Warnings class.
- Updated tests.
- More testing has resulted in minor code cleanup and refactoring.
- The
description
attribute ofACCOUNT
class will now return an empty string if its empty; it used to return None. - Fixed bug in parser that was stripping out the last values (columns) in a table row if they were empty. This was causing validation errors with missing attributes in Pydantic.
- Changed
CALENDAR
class variableCALENDAR_TYPES
(dict) toCalendarTypes
(Enum). wbs
argument is now required during initialization of aTASK
object.predecessor
andsuccessor
arguments are now required during initialization of aTASKPRED
object.
- This change focused on parsing Activity Code Data stored in a .xer file. This information is stored in the
ACTVTYPE
,ACTVCODE
, andTASKACTV
Tables. - WARNING: Some refactoring includes breaking changes, so this is being considered a
minor
version bump rather than apatch
.
- Added
ACTVTYPE
class to represent Activity Code Types. - Added
ACTVCODE
class to represent Activity Code Values. - Added
activity_code_types
(dict),activity_code_values
(dict),wbs_nodes
(dict),tasks
(dict) andrelationships
(dict) attributes toXer
class. - Added
activity_codes
attribute toTASK
class, which holds a dict ofACTVTYPE
,ACTVCODE
pairs assigned to a task via theTASKACTV
Table. - Added
activity_codes
attribute toPROJECT
class, which holds Project level activity code types. - Added
relationships_by_hash
property toPROJECT
class. Returns a dict with a hash of the relationship as the key and the relationship as the value. This is usefull for evaluating logic changes between two schedules; Unique IDs will change from schedule to schedule, but the hash value will be the same. Note: hash value is calculated based on predecessor task_code, successor task_code, and relationship link.
- Moved
conv_excel_date
function fromdates.py
to a Static Method of theCALENDAR
class. This function is only used to parse dates in theclndr_data
. - Moved
CALENDAR_TYPES
from being a Global variable incalendars.py
to be aCALENDAR
class variable. - The Global Regular Expression variables in
calendars.py
now use there.compile
method. - Renamed
fin_dates_id
attribute ofFINDATES
class touid
. This is consistent with the naming in other classes. - Renamed
fin_dates_name
attribute ofFINDATES
class toname
. This is consistent with the naming in other classes. MEMOTYPE
andTASKMEMO
classes no longer iherit from Pydantic BaseModel class. All attributes of bothMEMOTYPE
andTASKMEMO
are strings, so type validation is not needed.- Added
__eq__
and__hash__
methods toMEMOTYPE
class. - Moved Enumerators
ConstraintType
,PercentType
,TaskStatus
andTaskType
to inside theTASK
class. - Refactored how
calendars
,wbs_nodes
,tasks
andrelationships
attributes are assigned for thePROJECT
class. Each of these attributes is now a list rather than a dict or set. These objects are now referenced directly in theXer
class as a dict using its Unique ID as the key, so thePROJECT
reference to these objects can now be a simple list. PROJECT
propertiesactual_cost
,budgeted_cost
,remaining_cost
, andthis_period_cost
now return float values rounded to two decimal places.
- Removed
__str__
method fromWeekDay
class incalendars.py
. This was originally used for testing and is no longer needed. - Removed
print_cal
method fromCALENDAR
class. This were originally used for testing and is no longer needed.
This change focused on parsing Financial Periods and Past Period Data stored in a .xer file. This information is stored in the FINDATES
, TASKFIN
and TRSRCFIN
Tables.
- Added
FINDATES
class to represent Financial Periods. - Added
TASKFIN
class to represent Activity Past Period Actuals. - Added
TRSRCFIN
class to represent Activity Resource Assignment Past Period Actuals. Xer
class now hasfinancial_periods
(dict) attribute, which storesFINDATES
objects.TASK
class now has aperiods
(list) attribute, which storesTASKFIN
objects.TASKRSRC
class now has aperiods
(list) attribute, which storesTRSRCFIN
objects.
resources
attribute ofTASK
class changed from type list to type dict. This allows for easier assignment of financial period data (TRSRCFIN
) to task resources (TASKRSRC
).
- General code clean up and refactoring
Xer
class now has a class variableCODEC
, which stores the type of encoding for a .xer file.- Added
LinkToTask
class for use in storing aTASK
objects predecessor and successor links. Has propertiestask
,link
, andlag
. TASK
objects now have apredecessors
attribute, which holds a list ofLinkToTask
objects representing predecessor logic ties.TASK
objects now have asuccessors
attribute, which holds a list ofLinkToTask
objects representing successor logic ties.TASK
objects now have ahas_predecessor
property, which return True if task has at least one predecessor stored in itspredecessors
attribute.TASK
objects now have ahas_successors
property, which return True if task has at least one successor stored in itssuccessors
attribute.TASK
objects now have ahas_finish_successor
property, which return True if task has at least one Finish-Start or Finish-Finish logic tie (link) stored in itssuccessors
attribute. Will also return True if the task has no successors.TASK
objects now have ahas_start_predecessor
property, which return True if task has at least one Finish-Start or Start-Start logic tie (link) stored in itspredecessors
attribute. Will also return True if the task has no predecessors.
Xer
class no longer accepts raw .xer files as an argument. The xer file must be decoded into a string, which is then passed as an argument. This helps avoid multiple try / except statements to read the xer file.xer_to_dict
function no longer returns a dictionary with a 'tables' key. Each table name is now a top level key in the dictionary.xer_to_dict
function no longer parses the potential errors in the xer files. Errors are now parsed when theXer
object is initialized.Xer
attributenotebook
is renamed tonotebook_topic
to better define the objects stored in this attribute.Xer
attributeexport
is renamed toexport_info
to better define the values stored in this attribute.
- Working on a
ScheduleWarnings
class to provide schedule health analysis.