@@ -423,30 +423,6 @@ def _offset_str(self):
423
423
def nanos (self ):
424
424
raise ValueError ("{name} is a non-fixed frequency" .format (name = self ))
425
425
426
- def __setstate__ (self , state ):
427
- """Reconstruct an instance from a pickled state"""
428
- if 'offset' in state :
429
- # Older (<0.22.0) versions have offset attribute instead of _offset
430
- if '_offset' in state : # pragma: no cover
431
- raise AssertionError ('Unexpected key `_offset`' )
432
- state ['_offset' ] = state .pop ('offset' )
433
- state ['kwds' ]['offset' ] = state ['_offset' ]
434
-
435
- if '_offset' in state and not isinstance (state ['_offset' ], timedelta ):
436
- # relativedelta, we need to populate using its kwds
437
- offset = state ['_offset' ]
438
- odict = offset .__dict__
439
- kwds = {key : odict [key ] for key in odict if odict [key ]}
440
- state .update (kwds )
441
-
442
- self .__dict__ = state
443
- if 'weekmask' in state and 'holidays' in state :
444
- calendar , holidays = _get_calendar (weekmask = self .weekmask ,
445
- holidays = self .holidays ,
446
- calendar = None )
447
- self .calendar = calendar
448
- self .holidays = holidays
449
-
450
426
451
427
class SingleConstructorOffset (DateOffset ):
452
428
@classmethod
@@ -494,21 +470,6 @@ def _repr_attrs(self):
494
470
out += ': ' + ', ' .join (attrs )
495
471
return out
496
472
497
- def __getstate__ (self ):
498
- """Return a pickleable state"""
499
- state = self .__dict__ .copy ()
500
-
501
- # we don't want to actually pickle the calendar object
502
- # as its a np.busyday; we recreate on deserilization
503
- if 'calendar' in state :
504
- del state ['calendar' ]
505
- try :
506
- state ['kwds' ].pop ('calendar' )
507
- except KeyError :
508
- pass
509
-
510
- return state
511
-
512
473
513
474
class BusinessDay (BusinessMixin , SingleConstructorOffset ):
514
475
"""
@@ -690,7 +651,6 @@ def _get_business_hours_by_sec(self):
690
651
until = datetime (2014 , 4 , 1 , self .end .hour , self .end .minute )
691
652
return (until - dtstart ).total_seconds ()
692
653
else :
693
- self .daytime = False
694
654
dtstart = datetime (2014 , 4 , 1 , self .start .hour , self .start .minute )
695
655
until = datetime (2014 , 4 , 2 , self .end .hour , self .end .minute )
696
656
return (until - dtstart ).total_seconds ()
0 commit comments