瀏覽代碼

修改README.md以及读取数据的数据批次改为分析编号

wenjia Li 4 月之前
父節點
當前提交
716d393430
共有 2 個文件被更改,包括 10 次插入4 次删除
  1. 7 1
      README.md
  2. 3 3
      dataAnalysisBehavior/behavior/baseAnalyst.py

+ 7 - 1
README.md

@@ -69,4 +69,10 @@ WTOAAM
     # 解决windows环境plotly 包write_image方法 阻塞,使用如下包及版本:
     kaleido==0.1.0.post1
     plotly==5.19.0
-    plotly-express==0.4.1
+    plotly-express==0.4.1
+
+# 更新加载文件夹模块命令:
+1、安装build包:pip insatall build
+2、进入文件夹路径下运行python -m build命令,生成.whl文件和.tar.gz文件
+3、加载生成的.whl文件:pip install dist/dataAnalysisBusiness-1.2.202501161710-py3-none-any.whl(根据实际修改)
+4、加载完成继续测试

+ 3 - 3
dataAnalysisBehavior/behavior/baseAnalyst.py

@@ -472,7 +472,7 @@ class BaseAnalyst(ABC):
 
         return dataFrame
 
-    def loadData(self, dataBatchNum: str, timeGranularity: str, turbineCode: str, select: str, condition: str) -> pd.DataFrame:
+    def loadData(self, powerFarmID: str, timeGranularity: str, turbineCode: str, select: str, condition: str) -> pd.DataFrame:
         selectStr = ", ".join(f"{field}" for field in select)
         businessDB: DatabaseUtil = GetBusinessDbUtil()
         with businessDB.session_scope() as session:
@@ -480,7 +480,7 @@ class BaseAnalyst(ABC):
             #                    FROM `{dataBatchNum}_{timeGranularity}`
             #                    WHERE wind_turbine_number IN ({turbineCode}) AND {condition}"""
             query_text = f"""SELECT {selectStr}
-                               FROM `{dataBatchNum}_{timeGranularity}`
+                               FROM `{powerFarmID}_{timeGranularity}`
                                WHERE wind_turbine_number IN ({turbineCode}) AND {condition}"""
             query_result = session.execute(text(query_text)).fetchall()
 
@@ -499,7 +499,7 @@ class BaseAnalyst(ABC):
         # Get turbine model info
         currTurbineModelInfo = self.common.getTurbineModelByTurbine(currTurbineInfo, self.turbineModelInfo)
         # select DB data
-        dataFrameOfTurbine = self.loadData(dataBatchNum, timeGranularity, f"'{turbineCode}'", select, customCondition)
+        dataFrameOfTurbine = self.loadData(powerFarmID, timeGranularity, f"'{turbineCode}'", select, customCondition)
 
         if dataFrameOfTurbine.empty:
             self.logger.warning(f"{turbineCode} Time Granulary: {timeGranularity} scada data is empty.")