OpenSees面向对象的原生Python版本

o3seesp的Python项目详细描述


Testing StatusPyPi versionhttps://coveralls.io/repos/github/o3seespy/o3seespy/badge.svg?branch=masterhttps://readthedocs.org/projects/o3seespy/badge/?version=latest

o3seespy公司

OpenSees面向对象的原生python版本

特点

此软件包提供:

  1. A ‘pythonic’ version of OpenSees - all input parameters to create OpenSees objects are all lowercase key-value arguments - all class objects are CamelCase - static string variables defined in ALL_CAPS - Where possible the exact name used in the original TCL version has been kept
  2. Fully namespaced package allowing full auto-complete e.g. ‘o3.uniaxial_material.Steel01(…)’
  3. Replication of underlying object-oriented C++ source code using Python objects.
  4. Type checking of inputs before calling C++ OpenSees code, so that python debugging and errors can be viewed
  5. In code documentation using python docstrings - can view the documentation within your IDE
  6. Additional features for using OpenSees in python: - saving and loading data directly from OpenSees into numpy arrays - saving and loading data directly from OpenSees into json files - Save an entire model as a json file - allows efficient passing of models between servers
  7. All object numbering handled by objects - no need for number tags!
  8. Additional logic checking of optional inputs

如何使用

安装
pip install o3seespy

示例:动态非弹性单自由度分析

^{pr2}$ Output from example

有用材料

贡献

如何设置我?
  1. 运行pip install -r requirements.txt

包装惯例

  • 所有名称都应与OpenSees tcl版本相同,除了:
    • 对于参数或函数,名称应转换为snake_case
    • 对象的名称应转换为CamelCase
    • 对于静态变量,名称应转换为所有的\u CAPS
    • 如果名称与python的特殊名称匹配(例如lambda,in),则应根据字典对其进行调整
    • 对象应根据对象类型(例如元素、材质)命名
    • 对于跨多个对象(例如大气压力)使用的参数,应使用标准名称
    • OpenSees收集结果的函数名为“get”<;function name>;'
    • OpenSees生成结果的函数名为“gen”<;function name>;'
  • 杨氏模量应该如何命名?在
  • 如果所有两个node元素都使用i\u node,j_node。或者让它们都以列表的形式输入节点?在

测试

使用pytest运行测试

  • 在命令行本地运行:pytest。在
  • 使用travis在每次推送时都会运行测试,请参见.travis.yml文件

部署

将包部署到pypi.com网站您需要:

  1. 推到pypi分支。这将在上执行测试circleci.com网站在
  2. 创建一个git标记并推送到github,运行:trigger_deploy.py或手动:
git tag 0.5.2 -m "version 0.5.2"
git push --tags origin pypi

文档

通过狮身人面像建造如下:https://codeandchaos.wordpress.com/2012/07/30/sphinx-autodoc-tutorial-for-dummies/

发展模式

  1. cd to docs
  2. Run ^{tt5}$

Docstrings遵循numpy约定(正在进行):https://numpydoc.readthedocs.io/en/latest/format.html

在中修复long_描述设置.py:pip install collective.checkdocspython setup.py checkdocs

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何拆分字符串(基于各种分隔符),但不保留空格?   解析。Json格式的txt文件和knime中的java   java Spring rest api为什么在rest api调用的响应中更改了数据类型   升华文本3抛出java。lang.ClassNotFoundException,而记事本++不存在   java Android指纹扫描仪在尝试5次后停止工作?   java Android如何设置精确的重复报警?   java如何使用HTTPGET connect为access API输入用户名和密码   java当测试报告显示没有测试失败时,Gradle为什么说“有失败的测试”?   用Gson实现java获取响应   MapReduce程序中函数错误的java不可映射参数   java spring安全性不符合自动代理的条件   java GWT使用异步回调进行同步/阻塞调用   java奇怪的类数组问题无法在jsp中显示   如何在java中使用PrinterJob使用epl打印条形码   java如何在JTable中居中单元格   将Java Mockito测试转换为Kotlin   html Java正则表达式模式匹配到多个相同标记   testCompile中缺少java Gradle(Android)多项目依赖项   在输入提示后输入字符串时发生java FileNotFoundException