layout-generator
布局数据生成器 layout-generator,可按需求生成热源组件布局-稳态温度场数据集。
文档:ReadTheDocs
功能需求
- 可配置选项
- 布局板大小、边界要求
- 组件配置
- 大小
- 数量
- 形状
- 功率
- 采样方式
- 离散布局
- 均匀采样
- 连续布局
- 顺序摆放采样
- Gibbs 采样
- 离散布局
- fenics 求解器
- 均匀网格
- 网格分辨率
- 边界设置
- 多条边界
- 有限元 degree
- 线性叠加原理
- 数据集存储
- 文件前缀
- mat 格式
- HDF5
- 图片形式
- 其他
- 随机数种子
- 数据集可视化
layout_plot- 单一文件
- 目录批量处理
- multiprocess
- 性能
- multiprocess
- cluster
已实现功能
- 配置文件与命令行两种使用方式
- 矩形组件离散位置摆放
- 数量、位置、功率
- 固定组件位置,变功率采样
- 矩形组件连续位置摆放
- 可添加多条 Dirichlet 边界条件(开口)
- 使用
fenics求解 Poisson 方程- 分辨率、有限元 degree
- 数据集可视化脚本
layout_plot - 多线程支持
- 统一脚本入口
安装方式
本生成器依赖 fenics 作为有限元求解器,可参照 fenics 安装文档,推荐以下两种方式安装,如果没有没有 docker 使用经验推荐 Anaconda 方式
-
Anaconda (Linux, Mac)
- 使用
conda创建并激活环境
conda create -n fenicsproject -c conda-forge fenics mshr source activate fenicsproject
- use pip to install the released version
pip install -U layout-generator- or use unreleased version from master branch
pip install -U git+https://github.com/zweien/layout-generator.git
- 使用
-
Docker (Linux, Win, Mac)
- 从 dockerhub 拉取镜像
docker pull zweien/layout-generator:latest- 切换到需要生成数据集的目录,准备好配置文件
config.yml - 使用
config.yml在当前目录下生成数据集,数据集所在文件夹为data1
docker run --rm layout-generator:latest -v $(pwd):/home/fenics/layout layout_generater generate --config config.yml --data_dir data1
Notes:windows 下 cmd 中使用-v %cd%:/home/fenics/layout - 切换到需要生成数据集的目录,准备好配置文件
- 从 dockerhub 拉取镜像
FAQ
- Windows 下可以使用 Docker 方式安装,或在应用商店安装 Ubuntu WSL
- pip 安装前可使用国内源如清华
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
- 如果出现 HDF5 error,请使用如下命令重新安装
h5pypip uninstall h5py pip install --no-binary=h5py h5py
- 仅支持 Python3.6 以上版本
- 如果按照以上 anaconda 安装方式,别忘了切换到
fenicsproject环境
使用方法
请参见文档
Change Log
- v0.6.0
- add 固定组件位置,变功率采样
- add
layout_generator.generator.layout_pos2temp() - add
laytout_generator.sampler.continuous.base.Task.layout_from_pos() - add
layout_generator.generator.layout_pos_list2temp()for generating a sample according to paticular layout position list - add command
makeconfigfor generating template config
- v0.5.3
- fix bug in sequence sampling
- v0.5.2
- update installation guide
- add github action for pushing images to dockerhub
- v0.5.1
- fix file config.xml empty error
- add PyPi for installing
- add github action for publishing to PyPi
- v0.5.0
- 统一脚本入口
layout_generator- 离散布局
layout_generator generate - 连续布局
layout_generator generate_c - 可视化
layout_generator plot - 转换数据格式
layout_generator convert
- 离散布局
- 连续布局增加单个组件多种备选功率配置
- 统一脚本入口
- v0.4.2
- 删除默认 seed
- v0.4.1
- 增加 Dockerfile
- 更新安装方式
- 更新文档
- v0.4.0
- 增加连续布局 gibbs 采样
- 重构连续采样代码
- 增加 FAQ
- v0.3.0
- 增加连续布局生成脚本
layout-generator_c - 增加单元测试
- 文档迁移
- 增加连续布局生成脚本
- v0.2.2
- 增加转换脚本
layout_convert,实现 mat 到 HDF5 格式的转换 - 修复bug
--bcs [] - 增加单元测试
- 更新依赖
- 增加转换脚本
- v0.2.1
- 修改配置文件中 bcs 配置方式
- 重构部分代码
- 增加单元测试
- v0.2.0
- 增加 3D 数据生成
- 统一入口
layout_generator - 实现 3D Poisson solver
- vtk 数据存储
- 统一入口
- 增加 3D 数据生成
- v0.1.2
- 布局预处理,改进 fenics solver 性能
- 修改默认参数 method: fenics
- 增加可视化脚本
layout_plot- 单一文件 plot,保存
- 目录装换
- multiprocess 支持,增加 worker 参数
- v0.1.1
- 增加命令行入口
- 增加配置测试模式
- 更新 setup.py
Metadata
Release files for layout-generator 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| layout-generator-0.6.0.tar.gz | 30.6 kB | Without provenance | Details for layout-generator-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| layout_generator-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for layout_generator-0.6.0-py3-none-any.whl |
Total release size: 76.4 kB
Release files / layout-generator-0.6.0.tar.gz
| Download URL | layout-generator-0.6.0.tar.gz |
|---|---|
| Size | 30.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
244fcb4d07d9d6e3a739104a6c70c18c737a70bce9ad008a4ae81fd2fc2fa93b
|
|
BLAKE2b-256 checksum How to use checksums |
58ace3b0901fb67d8c909dc1563c16a48d175d6acf187956eea4d763ec9a2a3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10
|
Release files / layout_generator-0.6.0-py3-none-any.whl
| Download URL | layout_generator-0.6.0-py3-none-any.whl |
|---|---|
| Size | 45.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
673e2c7759b8d953ff8ef9af07e3821c0381ab0ca8e50f144aed30912c31a7d1
|
|
BLAKE2b-256 checksum How to use checksums |
b95d016fcdab12d55204cacaaacb6012d2c678df4a1225d3eebee30da357b19e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10
|
Security for layout-generator 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.