Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mppt-level-training
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
aakash.bedi
mppt-level-training
Commits
91322ba4
Commit
91322ba4
authored
Mar 07, 2023
by
aakash.bedi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated destructors
parent
b16a85d1
Pipeline
#59985
failed with stage
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
64 deletions
+89
-64
scripts/core/engine/ml_modelling.py
scripts/core/engine/ml_modelling.py
+89
-64
No files found.
scripts/core/engine/ml_modelling.py
View file @
91322ba4
...
@@ -19,6 +19,31 @@ class AiModelling:
...
@@ -19,6 +19,31 @@ class AiModelling:
for
inv_id
in
list
(
self
.
df_raw_tags
[
'inv_id'
]
.
unique
()):
for
inv_id
in
list
(
self
.
df_raw_tags
[
'inv_id'
]
.
unique
()):
df
=
self
.
df_raw_tags
[
self
.
df_raw_tags
[
'inv_id'
]
==
inv_id
]
df
=
self
.
df_raw_tags
[
self
.
df_raw_tags
[
'inv_id'
]
==
inv_id
]
for
mppt_id
in
list
(
self
.
df_raw_tags
[
'mppt_id'
]
.
unique
()):
for
mppt_id
in
list
(
self
.
df_raw_tags
[
'mppt_id'
]
.
unique
()):
print
(
f
'memory allocation for {inv_id} & {mppt_id} - {tracemalloc.get_traced_memory()}'
)
data_modelling
=
DataModelling
(
start_timestamp
=
self
.
start_timestamp
,
end_timestamp
=
self
.
end_timestamp
,
df_coefficients
=
self
.
df_coefficients
)
data_modelling
.
get_data
(
inv_id
=
inv_id
,
mppt_id
=
mppt_id
,
df
=
df
)
del
data_modelling
except
Exception
as
e
:
logger
.
exception
(
f
'Exception - {e}'
)
def
__del__
(
self
):
try
:
print
(
'destructor called, AiModelling die!'
)
except
Exception
as
e
:
logger
.
exception
(
f
'Exception - {e}'
)
class
DataModelling
:
def
__init__
(
self
,
start_timestamp
,
end_timestamp
,
df_coefficients
):
self
.
start_timestamp
=
start_timestamp
self
.
end_timestamp
=
end_timestamp
self
.
df_coefficients
=
df_coefficients
def
get_data
(
self
,
inv_id
,
mppt_id
,
df
):
try
:
print
(
f
'1st memory allocation for {inv_id} & {mppt_id} - {tracemalloc.get_traced_memory()}'
)
print
(
f
'1st memory allocation for {inv_id} & {mppt_id} - {tracemalloc.get_traced_memory()}'
)
gc
.
collect
()
gc
.
collect
()
tracemalloc
.
reset_peak
()
tracemalloc
.
reset_peak
()
...
@@ -87,6 +112,6 @@ class AiModelling:
...
@@ -87,6 +112,6 @@ class AiModelling:
def
__del__
(
self
):
def
__del__
(
self
):
try
:
try
:
print
(
'destructor called, die!'
)
print
(
'destructor called,
DataModelling
die!'
)
except
Exception
as
e
:
except
Exception
as
e
:
logger
.
exception
(
f
'Exception - {e}'
)
logger
.
exception
(
f
'Exception - {e}'
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment