算法

zhouyang.xie 999f5e6d5f 修改README.md文件,完善 获取依赖包的说明 9 hónapja
appBoot 0ca0fe62f7 first commit 11 hónapja
conf_template 038f3682bd first commit 11 hónapja
data 0ca0fe62f7 first commit 11 hónapja
dataAnalysisBehavior 35dc3885e3 删除分析结果返回值创建时间 10 hónapja
dataAnalysisBusiness b286984fec 后续部分修改更新 10 hónapja
dataAnalysisService 0ca0fe62f7 first commit 11 hónapja
dataContract 10fe7651d5 修改analysis_general_file插入操作(新增engine_type_code字段) 11 hónapja
repositoryZN 10fe7651d5 修改analysis_general_file插入操作(新增engine_type_code字段) 11 hónapja
wtoaamapi 038f3682bd first commit 11 hónapja
.gitignore 038f3682bd first commit 11 hónapja
README.md 999f5e6d5f 修改README.md文件,完善 获取依赖包的说明 9 hónapja

README.md

WTOAAM

风力发电机组运行分析算法模型 Wind turbine operation analysis algorithm model

django auth

http://127.0.0.1/admin
账号
admin
密码
root.123456

附加进程调试

安装debugpy

pip install --upgrade debugpy

运行程序命令

机组发电性能分析算法v1.1 示例: python -m debugpy --listen localhost:5678 --wait-for-client e:/WorkSpace/SourceCode/WTOAAM/wtoaamapi/apps/business/main.py

机组发电性能分析算法v1.2 调试示例: python -m debugpy --listen localhost:5678 .\wtoaamapi\manage.py runserver 0.0.0.0:8000 运行示例: python .\wtoaamapi\manage.py runserver 0.0.0.0:8000

附加进程

配置launch.json文件,内容如下: {

// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
    {
        "name": "Python: Remote Attach",  // 远程调试
        "type":"debugpy",
        "request": "attach",
        "connect": {
            "host": "localhost",
            "port": 5678
        },
        "pathMappings": [
            {
                "localRoot": "${workspaceFolder}",
                "remoteRoot": "."
            }
        ],
        "justMyCode": false
    }
    ]
}
打开要调试的源代码文件,在vscode搜索框选择"开始调试 debug","Python: Remote Attach"即lanuch.json文件中configurations[0].name节点值即可。

pip 包管理清理缓存

pip cache purge

打包为wheel及安装

pip uninstall [包名]   示例:pip uninstall dataAnalysisBusiness
python setup.py bdist_wheel   说明:在对应包的路径下执行此命令
pip install --force-reinstall ./dist/*.whl   说明:在对应包的路径下执行此命令 示例:pip install --force-reinstall dist/dataAnalysisBusiness-1.2.202406281547-py3-none-any.whl

第三方包版本冲突

# 解决windows环境plotly 包write_image方法 阻塞,使用如下包及版本:
kaleido==0.1.0.post1
plotly==5.19.0
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、加载完成继续测试

获取python程序依赖包

务必确保:python程序所依赖的python site-packages路径(其下的包均为对应程序版本的“”最新依赖)、用户权限,以确定应该使用的pip工具

方案一

此方案 验证成功 执行如下命令:

sudo /usr/local/python3.9/bin/pip3.9 freeze | grep -vE 'repositoryZN|dataAnalysisBehavior|dataAnalysisBusiness|dataContract|dataAnalysisService' > requirements.txt

sudo /usr/local/python3.9/bin/pip3.9 download -r requirements.txt -d download

方案二

此方案 验证未成功 ,保留以供继续研究

  1. pip install pip-tools pipreqs pipdeptree
  2. 执行命令 pipreqs [指定目录] --force 在 指定目录下 生成 requirements.txt 文件
  3. 执行命令 pip-compile requirements.txt --output-file=reqs.txt