mriusero commited on
Commit
f8d9c8a
·
1 Parent(s): e916724

core: cleaning

Browse files
src/production/flow.py CHANGED
@@ -1,8 +1,9 @@
 
1
  import random
 
 
2
  import numpy as np
3
  import pandas as pd
4
- import asyncio
5
- from datetime import datetime, timedelta
6
 
7
  from .downtime import machine_errors
8
 
 
1
+ import asyncio
2
  import random
3
+ from datetime import datetime, timedelta
4
+
5
  import numpy as np
6
  import pandas as pd
 
 
7
 
8
  from .downtime import machine_errors
9
 
src/production/metrics/tools.py CHANGED
@@ -1,8 +1,9 @@
1
- import numpy as np
2
- import pandas as pd
3
  import asyncio
4
  from concurrent.futures import ThreadPoolExecutor
5
 
 
 
 
6
  def stats_metrics(data, column, usl, lsl):
7
  rolling_mean = data[column].expanding().mean()
8
  rolling_std = data[column].expanding().std()
 
 
 
1
  import asyncio
2
  from concurrent.futures import ThreadPoolExecutor
3
 
4
+ import numpy as np
5
+
6
+
7
  def stats_metrics(data, column, usl, lsl):
8
  rolling_mean = data[column].expanding().mean()
9
  rolling_std = data[column].expanding().std()
src/ui/__init__.py CHANGED
@@ -1,2 +1,2 @@
 
1
  from src.ui.sidebar import sidebar_ui
2
- from src.ui.dashboard import dashboard_ui
 
1
+ from src.ui.dashboard import dashboard_ui
2
  from src.ui.sidebar import sidebar_ui
 
src/ui/dashboard.py CHANGED
@@ -1,13 +1,14 @@
1
- import gradio as gr
2
- import pandas as pd
3
  import asyncio
4
  from functools import partial
5
 
 
 
 
6
  from src.production.flow import generate_data
7
- from src.production.metrics.tools import tools_metrics
8
  from src.production.metrics.machine import machine_metrics, fetch_issues
9
- from src.ui.graphs.tools_graphs import ToolMetricsDisplay
10
  from src.ui.graphs.general_graphs import GeneralMetricsDisplay
 
11
 
12
  MAX_ROWS = 1000
13
  TOOLS_COUNT = 2
 
 
 
1
  import asyncio
2
  from functools import partial
3
 
4
+ import gradio as gr
5
+ import pandas as pd
6
+
7
  from src.production.flow import generate_data
 
8
  from src.production.metrics.machine import machine_metrics, fetch_issues
9
+ from src.production.metrics.tools import tools_metrics
10
  from src.ui.graphs.general_graphs import GeneralMetricsDisplay
11
+ from src.ui.graphs.tools_graphs import ToolMetricsDisplay
12
 
13
  MAX_ROWS = 1000
14
  TOOLS_COUNT = 2
src/ui/graphs/general_graphs.py CHANGED
@@ -1,5 +1,5 @@
1
  import gradio as gr
2
- import plotly.express as px
3
 
4
  class GeneralMetricsDisplay:
5
  def __init__(self):
 
1
  import gradio as gr
2
+
3
 
4
  class GeneralMetricsDisplay:
5
  def __init__(self):
src/ui/graphs/tools_graphs.py CHANGED
@@ -1,7 +1,7 @@
 
1
  import numpy as np
2
- from scipy.stats import norm
3
  import plotly.graph_objects as go
4
- import gradio as gr
5
 
6
 
7
  class ToolMetricsDisplay:
 
1
+ import gradio as gr
2
  import numpy as np
 
3
  import plotly.graph_objects as go
4
+ from scipy.stats import norm
5
 
6
 
7
  class ToolMetricsDisplay:
src/ui/session.py CHANGED
@@ -6,13 +6,13 @@ def show_toast(text):
6
 
7
  def play_fn(state):
8
  state['running'] = True
9
- print("\n\n===== Production started =====\n\n")
10
  show_toast("Production started !")
11
  return state
12
 
13
  def stop_fn(state):
14
  state['running'] = False
15
- print("\n\n----- Production stopped -----\n\n")
16
  show_toast("Production paused !")
17
  return state
18
 
@@ -22,7 +22,7 @@ def reset_fn(state):
22
  state['part_id'] = None
23
  state['data'] = {}
24
  state['machine'] = {}
25
- print("\n\n... production reinitialised successfully ...\n\n")
26
  show_toast("Production reset !")
27
  return state
28
 
 
6
 
7
  def play_fn(state):
8
  state['running'] = True
9
+ print("\n\n===== Production started =====")
10
  show_toast("Production started !")
11
  return state
12
 
13
  def stop_fn(state):
14
  state['running'] = False
15
+ print("----- Production stopped -----")
16
  show_toast("Production paused !")
17
  return state
18
 
 
22
  state['part_id'] = None
23
  state['data'] = {}
24
  state['machine'] = {}
25
+ print("----- Production rested -----\n\n")
26
  show_toast("Production reset !")
27
  return state
28
 
src/ui/sidebar.py CHANGED
@@ -1,4 +1,5 @@
1
  import gradio as gr
 
2
  from src.chat import respond
3
 
4
 
 
1
  import gradio as gr
2
+
3
  from src.chat import respond
4
 
5