Skip to content

Commit

Permalink
Merge pull request #354 from charan-teja2003/main
Browse files Browse the repository at this point in the history
edits in extras
  • Loading branch information
udayRage authored Apr 5, 2024
2 parents a9b5336 + 5ce2447 commit 2cc1878
Show file tree
Hide file tree
Showing 31 changed files with 441 additions and 183 deletions.
9 changes: 7 additions & 2 deletions PAMI/extras/DF2DB/DF2DB.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
#




__copyright__ = """
Copyright (C) 2021 Rage Uday Kiran
Copyright (C) 2021 Rage Uday Kiran
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -66,7 +68,7 @@ class DF2DB:
obj.getTemporal("outputFileName") # To create temporal database
obj.getUtility("outputFileName") # To create utility database
"""
"""


def __init__(self, inputDF, thresholdValue, condition, DFtype='sparse') -> None:
Expand All @@ -87,6 +89,7 @@ def getTransactionalDatabase(self, outputFile) -> str:
:param outputFile: file name or path to store database
:type outputFile: str
:return: outputFile name
:rtype: str
"""
self.DF2DB.createTransactional(outputFile)
return self.DF2DB.getFileName()
Expand All @@ -97,6 +100,7 @@ def getTemporalDatabase(self, outputFile) -> str:
:param outputFile: file name or path to store database
:type outputFile: str
:return: outputFile name
:rtype: str
"""
self.DF2DB.createTemporal(outputFile)
return self.DF2DB.getFileName()
Expand All @@ -107,6 +111,7 @@ def getUtilityDatabase(self, outputFile) -> str:
:param outputFile: file name or path to store database
:type outputFile: str
:return: outputFile name
:rtype: str
"""
self.DF2DB.createUtility(outputFile)
return self.DF2DB.getFileName()
Expand Down
10 changes: 8 additions & 2 deletions PAMI/extras/DF2DB/DF2DBPlus.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@
#
# obj.getUDB("outputFileName") # To create a utility database
#
#




__copyright__ = """
Copyright (C) 2021 Rage Uday Kiran
Copyright (C) 2021 Rage Uday Kiran
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -84,6 +87,7 @@ def getTransactional(self, outputFile) -> str:
:param outputFile: file name or path to store database
:type outputFile: str
:return: outputFile name
:rtype: str
"""
self.DF2DB.createTransactional(outputFile)
return self.DF2DB.getFileName()
Expand All @@ -94,6 +98,7 @@ def getTDB(self, outputFile) -> str:
:param outputFile: file name or path to store database
:type outputFile: str
:return: outputFile name
:rtype: str
"""
self.DF2DB.createTemporal(outputFile)
return self.DF2DB.getFileName()
Expand All @@ -104,6 +109,7 @@ def getUDB(self, outputFile) -> str:
:param outputFile: file name or path to store database
:type outputFile: str
:return: outputFile name
:rtype: str
"""
self.DF2DB.createUtility(outputFile)
return self.DF2DB.getFileName()
Expand Down
74 changes: 48 additions & 26 deletions PAMI/extras/DF2DB/DenseFormatDF.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@
# obj.convert2UtilityDatabase("outputFileName") # To create utility database
#
# obj.getFileName("outputFileName") # To get file name of the database
#





__copyright__ = """
Copyright (C) 2021 Rage Uday Kiran
Copyright (C) 2021 Rage Uday Kiran
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -96,12 +101,17 @@ def convert2TransactionalDatabase(self, outputFile: str, condition: str, thresho
:Attributes:
:param outputFile: str :
Write transactional database into outputFile
:param condition: str :
It is condition to judge the value in dataframe
:param thresholdValue: int or float :
User defined value.
:param outputFile: Write transactional database into outputFile
:type outputFile: str
:param condition: It is condition to judge the value in dataframe
:type condition: str
:param thresholdValue: User defined value.
:type thresholdValue: Union[int, float]
"""


Expand All @@ -125,15 +135,19 @@ def convert2TransactionalDatabase(self, outputFile: str, condition: str, thresho

def convert2TemporalDatabase(self, outputFile: str, condition: str, thresholdValue: Union[int, float]) -> None:
"""
:Description: Create temporal database
:Description: Create temporal database
:param outputFile: str :
Write temporal database into outputFile
:param condition: str :
It is condition to judge the value in dataframe
:param thresholdValue: int or float :
User defined value.
:param outputFile: Write temporal database into outputFile
:type outputFile: str
:param condition: It is condition to judge the value in dataframe
:type condition: str
:param thresholdValue: User defined value.
:type thresholdValue: Union
"""

self.outputFile = outputFile
Expand All @@ -158,17 +172,21 @@ def convert2TemporalDatabase(self, outputFile: str, condition: str, thresholdVal
def convert2MultipleTimeSeries(self, interval: int, outputFile: str, condition: str,
thresholdValue: Union[int, float]) -> None:
"""
:Description: Create the multiple time series database.
:Description: Create the multiple time series database.
:param outputFile: str :
Write multiple time series database into outputFile.
:param interval: int:
Breaks the given timeseries into intervals.
:param condition: str :
It is condition to judge the value in dataframe
:param thresholdValue: int or float :
User defined value.
:param outputFile: Write multiple time series database into outputFile.
:type outputFile: str
:param interval: Breaks the given timeseries into intervals.
:type interval: int
:param condition: It is condition to judge the value in dataframe
:param thresholdValue: User defined value.
:type thresholdValue: int or float
"""
self.outputFile = outputFile
writer = open(self.outputFile, 'w+')
Expand Down Expand Up @@ -233,10 +251,13 @@ def convert2UncertainTransactional(self, outputFile: str, condition: str,

def convert2UtilityDatabase(self, outputFile: str) -> None:
"""
:Description: Create the utility database.
:Description: Create the utility database.
:param outputFile: Write utility database into outputFile
:type outputFile: str
:param outputFile: str :
Write utility database into outputFile
:return: None
"""

self.outputFile = outputFile
Expand All @@ -256,6 +277,7 @@ def convert2UtilityDatabase(self, outputFile: str) -> None:
def getFileName(self) -> str:
"""
:return: outputFile name
:rtype: str
"""

return self.outputFile
Expand Down
12 changes: 8 additions & 4 deletions PAMI/extras/DF2DB/SparseFormatDF.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
#
# obj.getFileName("outputFileName") # To get file name of the database
#
#
#




__copyright__ = """
Copyright (C) 2021 Rage Uday Kiran
Copyright (C) 2021 Rage Uday Kiran
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -94,7 +96,7 @@ def createTransactional(self, outputFile: str) -> None:
Create transactional data base
:param outputFile: Write transactional data base into outputFile
:type outputFile: str
:return: None
"""
self.outputFile = outputFile
with open(self.outputFile, 'w') as f:
Expand All @@ -109,6 +111,7 @@ def createTemporal(self, outputFile: str) -> None:
Create temporal data base
:param outputFile: Write temporal data base into outputFile
:type outputFile: str
:return: None
"""

self.outputFile = outputFile
Expand All @@ -124,6 +127,7 @@ def createUtility(self, outputFile: str) -> None:
Create the utility database.
:param outputFile: Write utility database into outputFile
:type outputFile: str
:return: None
"""

self.outputFile = outputFile
Expand Down
4 changes: 3 additions & 1 deletion PAMI/extras/DF2DB/createTDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#
# obj.save(oFile)
#
#




import sys

Expand Down
12 changes: 8 additions & 4 deletions PAMI/extras/DF2DB/denseDF2DBPlus.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
#
# obj.getFileName("outputFileName") # To get file name of the database
#
#
#




__copyright__ = """
Copyright (C) 2021 Rage Uday Kiran
Copyright (C) 2021 Rage Uday Kiran
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -69,7 +71,6 @@ class DenseFormatDFPlus:
obj.getFileName("outputFileName") # To get file name of the database
"""

def __init__(self, inputDF, thresholdConditionDF) -> None:
Expand All @@ -88,6 +89,7 @@ def createTransactional(self, outputFile: str) -> None:
Create transactional data base
:param outputFile: Write transactional data base into outputFile
:type outputFile: str
:return: None
"""

self.outputFile = outputFile
Expand Down Expand Up @@ -117,6 +119,7 @@ def createTemporal(self, outputFile: str) -> None:
Create temporal data base
:param outputFile: Write temporal data base into outputFile
:type outputFile: str
:return: None
"""

self.outputFile = outputFile
Expand Down Expand Up @@ -145,6 +148,7 @@ def createUtility(self, outputFile: str) -> None:
Create the utility data base.
:param outputFile: Write utility data base into outputFile
:type outputFile: str
:return: None
"""

self.outputFile = outputFile
Expand Down
29 changes: 20 additions & 9 deletions PAMI/extras/DF2DB/denseDF2DB_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
#
# obj.getFileName("outputFileName") # To get file name of the database
#
#
#




__copyright__ = """
Copyright (C) 2021 Rage Uday Kiran
Expand Down Expand Up @@ -87,8 +89,11 @@ def createTransactional(self, outputFile: str) -> None:
"""
:Description: Create transactional data base
:param outputFile: str :
Write transactional data base into outputFile
:param outputFile: Write transactional data base into outputFile
:type outputFile: str
:return: None
"""

Expand Down Expand Up @@ -176,11 +181,13 @@ def createTransactional(self, outputFile: str) -> None:

def createTemporal(self, outputFile: str) -> None:
"""
:Description: Create temporal data base
:Description: Create temporal data base
:param outputFile: Write temporal data base into outputFile
:param outputFile: str :
Write temporal data base into outputFile
:type outputFile: str
:return: None
"""

self.outputFile = outputFile
Expand Down Expand Up @@ -275,9 +282,11 @@ def createUtility(self, outputFile: str) -> None:
:Description: Create the utility database.
:param outputFile: str :
:param outputFile: Write utility database into outputFile
Write utility database into outputFile
:type outputFile: str
:return: None
"""

Expand All @@ -297,6 +306,8 @@ def createUtility(self, outputFile: str) -> None:
def getFileName(self) -> str:
"""
:return: outputFile name
:rtype: str
"""

return self.outputFile
Expand Down
Loading

0 comments on commit 2cc1878

Please sign in to comment.