Ansaribinhyder commited on
Commit
e5c8dbf
·
1 Parent(s): 7bc9ae5

Updated Readme

Browse files

Added auto folder creation

Files changed (2) hide show
  1. README.md +9 -0
  2. SPC_System/spc_engine.py +14 -1
README.md CHANGED
@@ -12,3 +12,12 @@ short_description: This space is created to compare the test data
12
  ---
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
12
  ---
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
15
+
16
+ <h1>Added new SPC system</h1>
17
+
18
+ <h2>To check this out in your local environment</h2>
19
+ Keep the input file in the same folder
20
+ Key in the input file in the terminal
21
+ Run the spc_engine.py
22
+ This will generate all the graphs inside chart folder
23
+
SPC_System/spc_engine.py CHANGED
@@ -2,6 +2,8 @@ import json
2
  import pandas as pd
3
  import numpy as np
4
  import matplotlib.pyplot as plt
 
 
5
 
6
  file = input("Select the file to analyze or type in the file name (Should be .xlsx)")
7
  INPUT_EXCEL = file
@@ -105,7 +107,18 @@ for param in parameter:
105
 
106
  plt.tight_layout()
107
  # plt.show()
108
- chart_path = f"./charts/control_chart_{param}.png"
 
 
 
 
 
 
 
 
 
 
 
109
  plt.savefig(chart_path, dpi=300, bbox_inches='tight')
110
  plt.close()
111
 
 
2
  import pandas as pd
3
  import numpy as np
4
  import matplotlib.pyplot as plt
5
+ import os
6
+
7
 
8
  file = input("Select the file to analyze or type in the file name (Should be .xlsx)")
9
  INPUT_EXCEL = file
 
107
 
108
  plt.tight_layout()
109
  # plt.show()
110
+ # chart_path = f"./charts/control_chart_{param}.png"
111
+
112
+ # Folder path
113
+ folder = "./charts"
114
+
115
+ # Create folder if not exists
116
+ os.makedirs(folder, exist_ok=True)
117
+
118
+ # File path
119
+ chart_path = f"{folder}/control_chart_{param}.png"
120
+
121
+
122
  plt.savefig(chart_path, dpi=300, bbox_inches='tight')
123
  plt.close()
124