Skip to content

Commit

Permalink
A few more file changes were missing from the v23 merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Shay Carter committed May 9, 2024
1 parent 285ce9c commit a05510b
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

# File auto-generated against equivalent DynamicSerialize Java class
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# Apr 11, 2023 2033903 mapeters Generated

class FileUpdatedMessage(object):

def __init__(self):
self.timeStamp = None
self.fileName = None
self.changeType = None
self.context = None
self.checkSum = None

def getTimeStamp(self):
return self.timeStamp

def setTimeStamp(self, timeStamp):
self.timeStamp = timeStamp

def getFileName(self):
return self.fileName

def setFileName(self, fileName):
self.fileName = fileName

def getChangeType(self):
return self.changeType

def setChangeType(self, changeType):
self.changeType = changeType

def getContext(self):
return self.context

def setContext(self, context):
self.context = context

def getCheckSum(self):
return self.checkSum

def setCheckSum(self, checkSum):
self.checkSum = checkSum

Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ def getOrder(self):

def setOrder(self, order):
self.order = int(order)

def isSystemLevel(self):
return self.systemLevel

def __str__(self):
return self.__repr__()

def __repr__(self):
return str(self.text)

Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
# File auto-generated by PythonFileGenerator

__all__ = [
'FileUpdatedMessage',
'LocalizationContext',
'LocalizationLevel',
'LocalizationType',
'msgs',
'stream'
]

from .FileUpdatedMessage import FileUpdatedMessage
from .LocalizationContext import LocalizationContext
from .LocalizationLevel import LocalizationLevel
from .LocalizationType import LocalizationType
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# #
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
# #

# File auto-generated against equivalent DynamicSerialize Java class
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# Mar 30, 2021 8374 randerso Generated


class DatasetNamesResponse(object):

def __init__(self):
self.datasets = None

def getDatasets(self):
return self.datasets

def setDatasets(self, datasets):
self.datasets = datasets
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
##
# #
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
# #

# File auto-generated by PythonFileGenerator

__all__ = [
'DatasetNamesResponse',
'DeleteResponse',
'ErrorResponse',
'FileActionResponse',
'RetrieveResponse',
'StoreResponse'
]

from .DatasetNamesResponse import DatasetNamesResponse
from .DeleteResponse import DeleteResponse
from .ErrorResponse import ErrorResponse
from .FileActionResponse import FileActionResponse
Expand Down
54 changes: 43 additions & 11 deletions dynamicserialize/dstypes/com/raytheon/uf/common/time/DataTime.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
# plus misc cleanup
# 09/13/19 7888 tgurney Python 3 division fixes
# 11/18/19 7881 tgurney Fix __hash__
# 08/31/23 srcarter@ucar Small formatting fixes to match MJ's changes
# 10/28/22 8959 mapeters Add levelType
# 07/28/23 2035971 mapeters Remove incorrect levelType comparison in __lt__


import calendar
Expand All @@ -60,8 +61,12 @@
_MILLIS = '(?:\.(\d{1,3})(?:\d{1,4})?)?'
REFTIME_PATTERN_STR = _DATE + '[ _]' + _TIME + _MILLIS
FORECAST_PATTERN_STR = r'(?:[ _]\((\d+)(?::(\d{1,2}))?\))?'
VALID_PERIOD_PATTERN_STR = r'(?:\[' + REFTIME_PATTERN_STR + '--' + REFTIME_PATTERN_STR + r'\])?'
STR_PATTERN = re.compile(REFTIME_PATTERN_STR + FORECAST_PATTERN_STR + VALID_PERIOD_PATTERN_STR)
VALID_PERIOD_PATTERN_STR = r'(?:\[' + REFTIME_PATTERN_STR + \
'--' + REFTIME_PATTERN_STR + r'\])?'
STR_PATTERN = re.compile(
REFTIME_PATTERN_STR +
FORECAST_PATTERN_STR +
VALID_PERIOD_PATTERN_STR)


class DataTime(object):
Expand All @@ -85,14 +90,19 @@ def __init__(self, refTime=None, fcstTime=None, validPeriod=None):
self.fcstTime = 0
self.refTime = refTime
if validPeriod is not None and not isinstance(validPeriod, TimeRange):
raise ValueError("Invalid validPeriod object specified for DataTime.")
raise ValueError(
"Invalid validPeriod object specified for DataTime.")
self.validPeriod = validPeriod
self.utilityFlags = EnumSet('com.raytheon.uf.common.time.DataTime$FLAG')
self.utilityFlags = EnumSet(
'com.raytheon.uf.common.time.DataTime$FLAG')
self.levelValue = numpy.float64(-1.0)
self.levelType = None

if self.refTime is not None:
if isinstance(self.refTime, datetime.datetime):
self.refTime = int(calendar.timegm(self.refTime.utctimetuple()) * 1000)
self.refTime = int(
calendar.timegm(
self.refTime.utctimetuple()) * 1000)
elif isinstance(self.refTime, time.struct_time):
self.refTime = int(calendar.timegm(self.refTime) * 1000)
elif hasattr(self.refTime, 'getTime'):
Expand All @@ -117,7 +127,8 @@ def __init__(self, refTime=None, fcstTime=None, validPeriod=None):
fcstTimeMin = groups[4]
periodStart = groups[5], groups[6], (groups[7] or 0)
periodEnd = groups[8], groups[9], (groups[10] or 0)
self.refTime = self._getTimeAsEpochMillis(rDate, rTime, rMillis)
self.refTime = self._getTimeAsEpochMillis(
rDate, rTime, rMillis)

if fcstTimeHr is not None:
self.fcstTime = int(fcstTimeHr) * 3600
Expand All @@ -126,7 +137,8 @@ def __init__(self, refTime=None, fcstTime=None, validPeriod=None):

if periodStart[0] is not None:
self.validPeriod = TimeRange()
periodStartTime = self._getTimeAsEpochMillis(*periodStart)
periodStartTime = self._getTimeAsEpochMillis(
*periodStart)
self.validPeriod.setStart(periodStartTime // 1000)
periodEndTime = self._getTimeAsEpochMillis(*periodEnd)
self.validPeriod.setEnd(periodEndTime // 1000)
Expand Down Expand Up @@ -175,6 +187,12 @@ def getLevelValue(self):
def setLevelValue(self, levelValue):
self.levelValue = numpy.float64(levelValue)

def getLevelType(self):
return self.levelType

def setLevelType(self, levelType):
self.levelType = levelType

def __str__(self):
buffer = io.StringIO()

Expand Down Expand Up @@ -213,7 +231,7 @@ def __hash__(self):
if self.getRefTime() is None:
return hash(self.fcstTime)
return hash((self.refTime, self.fcstTime,
self.validPeriod, self.levelValue))
self.validPeriod, self.levelValue, self.levelType))

def __eq__(self, other):
if not isinstance(self, type(other)):
Expand All @@ -226,12 +244,14 @@ def __eq__(self, other):
self.refTime,
self.fcstTime,
self.validPeriod,
self.levelValue)
self.levelValue,
self.levelType)
dataTime2 = (
other.refTime,
other.fcstTime,
other.validPeriod,
other.levelValue)
other.levelValue,
other.levelType)
return dataTime1 == dataTime2

def __ne__(self, other):
Expand All @@ -249,6 +269,12 @@ def __lt__(self, other):
if self.fcstTime < other.fcstTime:
return True

if self.levelType != other.levelType:
if self.levelType is None:
return True
elif other.levelType is not None and self.levelType < other.levelType:
return True

if self.levelValue < other.levelValue:
return True

Expand Down Expand Up @@ -278,6 +304,12 @@ def __gt__(self, other):
if self.fcstTime > other.fcstTime:
return True

if self.levelType != other.levelType:
if other.levelType is None:
return True
elif self.levelType is not None and self.levelType > other.levelType:
return True

if self.levelValue > other.levelValue:
return True

Expand Down

0 comments on commit a05510b

Please sign in to comment.