Fixed case where optional PROJECT variable last_fin_dates_id data does not exist in the XER file. Reference Issue #15
Removed TASKPRED as a required table for error checking. Reference Issue #12
- Handle edge case where incorrect data date is recorded in the XER file; revert to planned start date in these cases. May need to re-create the the xer_data.json file when running the tests.
- Added
duration_percent_completeandunits_percent_completeproperties to theTASKclass. - Updated the
phys_complete_pctattribute to be a decimal from 0 to 1.
Adding day_hr_cnt, week_hr_cnt, year_hr_cnt as optional_float to calendar object.
In TASKRSRC class, changed data type of target_lag_drtn_hr_cnt property from int to float. Reference Issue #10
- Added properties to
PROJWBSclass:projectgives PROJWBS objects access to the project and its properties.original_durationcalendar days between start and finish dates.actual_durationcalendar days between the project data date the wbs start date.remaining_durationcalendar days between the wbd finish date and the project data date.
- Added
all_taskproperty toPROJWBSclass, which returns all tasks assigned to a node and all it's children nodes. - Added
actual_cost,budgeted_cost,remaining_cost, andthis_period_costproperties toPROJWBSclass. These are sums of the costs for all activities under a WBS node. - Added
startandfinishproperties toPROJWBSclass. PROJWBSobjects are now sorted by seq_num to match the order reflected in P6.
Nodeobject now useseq_numattribute for comparison and sorting.- Fixed potential bug in how children are stored in the
Nodeclass; 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
Nodeobjects:traverse_parentsmethod iterates through parents to root node.traverse_childrenmethod iterates through all children to leaves.heightproperty is the length of the longest downward path to a leaf from a given node (leaf nodes with have a height of 0).depthproperty 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
SCHEDOPTIONSclass due to missing attributes in files exported from older versions of P6. Issue #7 - Fixed bug where
create_dateandupdate_dateattributes of theTASKclass may be empty. Issue #8
- Added
tasks(list[TASK]) attribute toPROJWBSclass. - Added
task_rsrcs(list[TASKRSRC]) attribute toRSRCclass.
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
RSRCRATEwhich represents a Resource Rate. This can be accessed from theresource_rate(dict) attribute of theXerobject. Issue #6
- Refactored inheritance for
Nodeobjects.- The
descriptionattribute of theACTVCODEandPCATVALclasses has been changed toname.
- The
- Fixed bug in the equal override function for the
RSRCobject; missing a return.
- Updated type hints, which now requires a minimum of Python 3.11.
RSRCclass now inherits fromNode.- Updating / filling in docstrings.
- Updated dependencies to new versions.
ACCOUNTclass equal overide now checks if other object is None type.- The
max_multiple_longest_pathattribute of theSCHEDOPTIONSclass can be type int or None.
- Added
Nodeclass to represent a Tree data structure - can have one parent and multiple children.ACCOUNT,ACTVCODE,PCATVAL, andPROJWBSclasses now inherit fromNodeclass.
- Updated dependency
html-sanitizerto the latest version2.2.0 - Added
Nodeclass to represent a Tree data structure - can have one parent and multiple children. ACCOUNT,ACTVCODE,PCATVAL, andPROJWBSclasses now inherit fromNodeclass.
- Added
is_wbsproperty toTaskTypeenum class. Checks if task is a wbs summary type.
- Added
wbs_rootattribute to thePROJECTclass. This is the root WBS node. - Added
childrenattribute to thePROJWBSclass. Along with thewbs_rootabove, this forms a Tree Data Structure. - Added
childrenattribute to theACCOUNTclass. - Added
childrenattribute to theACTVCODEclass. - Added
childrenattribute to thePCATVALclass.
- Changed the
PROJECTnamefrom an attribute to a property. The project name is stored in thewbs_rootadded above.
- The
task_percentproperty of thePROJECTclass 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
TASKPREDobjects.
- Bug fixes with validating data types for
TASKobjects.
- Added
resourcesattribute containing a list ofTASKRSRCobjects to thePROJECTclass. Previously,TASKRSRCobjects were only accessible through aTASKobject.
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_duartionproperty toPROJECTclass.
Some code cleanup and corrections to the python code in the README file.
- Added function
file_readerwhich 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
readerto theXerclass. A .xer file can be passed directly to this method, which will read and decode the file, and return aXerobject. Uses thefile_readerfunction above.
- Changed name of function
xer_to_dicttoparser.
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_errorsfunction. 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_idassigned to aTASKRSRCobject.
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
calendarattribute of theTASKclass to be typeNone; AllTASKobjects must have acalendaror theCorruptXerFileException is raised. - Removed option for the
resourceattribute of theTASKRSRCclass to be typeNone; allTASKRSRCobjects must have aresourceor theCorruptXerFileException is raised.
- Added
actual_total_costproperty toTASKFINclass - Added
late_startproperty toPROJECTclass
TASKmethodrem_hours_per_daycan now accept alateflag (bool) to calculate late dates rather than early dates.
Refactor / cleanup code. Working on functionality to generate cost loading projections.
- Added
rem_hours_per_daymethod toTASKclass. This return a dict with date: workhour key value pairs. This function was originally contained within thecalendar.pymodule, but was not being used. Makes more sense to have it as aTASKmethod. - Added
base_calendarattribute toCALENDARclass. Theis_workdayfunction will now search thebase_calendarfor holidays when determining if a date is a workday.
remain_drtn_hr_cntattribute ofTASKno longer allowsNonetype.finishproperty ofTASKwill now check forreend_dateand 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
UDFTYPEwhich represents a User Defined Field. - Added attribute
user_defined_fieldstoPROJECT,PROJWBS,RSRC, andTASKclasses, which hold a dictionary ofUDFTYPE:UDF Valuekey value pairs.
Added parsing of Project Codes. Issue #3.
- Added class
PCATTYPEwhich represents a Project Code Type. - Added class
PCATVALwhich represents a Project Code Value. - Added attribute
project_code_typestoXerclass, which holds a dictionary ofPCATTYPEobjects. - Added attribute
project_code_valuestoXerclass, which holds a dictionary ofPCATVALobjects. - Added attribute
project_codestoPROJECTclass, which holds a dictionary ofPCATTYPE:PCATVALkey 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 toCALENDARclass. Returns number of workdays in a week.
- Removed
warnings.pyfrom project. This may become a seperate project.
- Added
default_calendarattribute toPROJECTclass.
- Added
SCHEDOPTIONSclass. - Added
optionsattribute thePROJECTclass, which is aSCHEDOPTIONSobject.` - Added
lineageandfull_codeproperties to theACTVCODEclass. Issue #2
- Comparison operators for
ACTVCODEare now based onfull_codeproperty rather thancodeproperty.
Added some additional features noted below, and continue working on Warnings class.
- Added
lineageproperty toPROJWBSclass. Returns list of all ancestorPROJWBSobjects, including self. - Added
durationproperty toTASKclass. This will returnremaining_durationif 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_codeproperty toACCOUNTclass. This property returns the full path to the cost code including any parent codes. This property is now the basis for comparingACCOUNTobjects.
- Small amount of code cleanup and refactoring.
- Added
parent_acct_idandseq_numattributes toACCOUNTclass. - Added
parentproperty toACCOUNTclass.
- 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
errorsattribute ofXerclass.
- Moved functions
is_workday,iter_holidays, anditer_workdaysto be methods of theCALENDARclass. - The
budgeted_cost,actual_cost,this_period_cost, andremaining_costproperties of theTASKclass now return float values rounded to two decimal places. Warning: this may cause thePROJECTlevel 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_successorofTASKclass. 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
descriptionattribute ofACCOUNTclass 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
CALENDARclass variableCALENDAR_TYPES(dict) toCalendarTypes(Enum). wbsargument is now required during initialization of aTASKobject.predecessorandsuccessorarguments are now required during initialization of aTASKPREDobject.
- This change focused on parsing Activity Code Data stored in a .xer file. This information is stored in the
ACTVTYPE,ACTVCODE, andTASKACTVTables. - WARNING: Some refactoring includes breaking changes, so this is being considered a
minorversion bump rather than apatch.
- Added
ACTVTYPEclass to represent Activity Code Types. - Added
ACTVCODEclass to represent Activity Code Values. - Added
activity_code_types(dict),activity_code_values(dict),wbs_nodes(dict),tasks(dict) andrelationships(dict) attributes toXerclass. - Added
activity_codesattribute toTASKclass, which holds a dict ofACTVTYPE,ACTVCODEpairs assigned to a task via theTASKACTVTable. - Added
activity_codesattribute toPROJECTclass, which holds Project level activity code types. - Added
relationships_by_hashproperty toPROJECTclass. 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_datefunction fromdates.pyto a Static Method of theCALENDARclass. This function is only used to parse dates in theclndr_data. - Moved
CALENDAR_TYPESfrom being a Global variable incalendars.pyto be aCALENDARclass variable. - The Global Regular Expression variables in
calendars.pynow use there.compilemethod. - Renamed
fin_dates_idattribute ofFINDATESclass touid. This is consistent with the naming in other classes. - Renamed
fin_dates_nameattribute ofFINDATESclass toname. This is consistent with the naming in other classes. MEMOTYPEandTASKMEMOclasses no longer iherit from Pydantic BaseModel class. All attributes of bothMEMOTYPEandTASKMEMOare strings, so type validation is not needed.- Added
__eq__and__hash__methods toMEMOTYPEclass. - Moved Enumerators
ConstraintType,PercentType,TaskStatusandTaskTypeto inside theTASKclass. - Refactored how
calendars,wbs_nodes,tasksandrelationshipsattributes are assigned for thePROJECTclass. Each of these attributes is now a list rather than a dict or set. These objects are now referenced directly in theXerclass as a dict using its Unique ID as the key, so thePROJECTreference to these objects can now be a simple list. PROJECTpropertiesactual_cost,budgeted_cost,remaining_cost, andthis_period_costnow return float values rounded to two decimal places.
- Removed
__str__method fromWeekDayclass incalendars.py. This was originally used for testing and is no longer needed. - Removed
print_calmethod fromCALENDARclass. 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
FINDATESclass to represent Financial Periods. - Added
TASKFINclass to represent Activity Past Period Actuals. - Added
TRSRCFINclass to represent Activity Resource Assignment Past Period Actuals. Xerclass now hasfinancial_periods(dict) attribute, which storesFINDATESobjects.TASKclass now has aperiods(list) attribute, which storesTASKFINobjects.TASKRSRCclass now has aperiods(list) attribute, which storesTRSRCFINobjects.
resourcesattribute ofTASKclass 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
Xerclass now has a class variableCODEC, which stores the type of encoding for a .xer file.- Added
LinkToTaskclass for use in storing aTASKobjects predecessor and successor links. Has propertiestask,link, andlag. TASKobjects now have apredecessorsattribute, which holds a list ofLinkToTaskobjects representing predecessor logic ties.TASKobjects now have asuccessorsattribute, which holds a list ofLinkToTaskobjects representing successor logic ties.TASKobjects now have ahas_predecessorproperty, which return True if task has at least one predecessor stored in itspredecessorsattribute.TASKobjects now have ahas_successorsproperty, which return True if task has at least one successor stored in itssuccessorsattribute.TASKobjects now have ahas_finish_successorproperty, which return True if task has at least one Finish-Start or Finish-Finish logic tie (link) stored in itssuccessorsattribute. Will also return True if the task has no successors.TASKobjects now have ahas_start_predecessorproperty, which return True if task has at least one Finish-Start or Start-Start logic tie (link) stored in itspredecessorsattribute. Will also return True if the task has no predecessors.
Xerclass 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_dictfunction no longer returns a dictionary with a 'tables' key. Each table name is now a top level key in the dictionary.xer_to_dictfunction no longer parses the potential errors in the xer files. Errors are now parsed when theXerobject is initialized.Xerattributenotebookis renamed tonotebook_topicto better define the objects stored in this attribute.Xerattributeexportis renamed toexport_infoto better define the values stored in this attribute.
- Working on a
ScheduleWarningsclass to provide schedule health analysis.