Skip to content

Commit

Permalink
start coding
Browse files Browse the repository at this point in the history
add code to read geometry #11
add code to read solar mask data #12
  • Loading branch information
prudhomm committed May 23, 2024
1 parent 6cfc8a3 commit ddb89d5
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 37 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ jobs:
env:
CXX: clang++

-
name: Tests
run: |
source .venv/bin/activate
pytest
pytest --nbmake src/notebooks/**/*.ipynb
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
Expand Down
27 changes: 27 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,33 @@

ICCS and Cemosis team

== Setup Environment

To start, you need to install the following tools:

[.sh]
----
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
----

== Visual Studio Code

In order to use Visual Studio Code, you need to install the following extensions:

- Python
- C/C++
- CMake
- Docker

Then you can open the project in Visual Studio Code and start coding:

- open the notebook `src/notebooks/feelpp.ipynb` and run the cells




= {feelpp} Template Project
Christophe Prud'homme <https://github.com/prudhomm[@prudhomm]>
v2:
Expand Down
13 changes: 8 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ build-backend = "scikit_build_core.build"

[project]
name = "kub-hpda-ml"
version = "3.0.1"
description="Kub Hpda Ml"
version = "0.1.0"
description="KTirio Urban Building HPDA and ML processing"
readme = "README.md"
authors = [
{ name = "Christophe Prud'homme", email = "[email protected]" },
{ name = "Javier Cladellas", email = "[email protected]"}
]
requires-python = ">=3.7"
classifiers = [
Expand All @@ -29,7 +30,9 @@ test = ["pytest"]

[tool.scikit-build]
wheel.expand-macos-universal-tags = true

wheel.packages = ["src/feelpp/"]
cmake.verbose = true
logging.level = "INFO"

[tool.pytest.ini_options]
minversion = "6.0"
Expand All @@ -39,8 +42,8 @@ filterwarnings = [
"error",
"ignore:(ast.Str|Attribute s|ast.NameConstant|ast.Num) is deprecated:DeprecationWarning:_pytest", # Python 3.12
]
# testpaths = ["tests"]

testpaths = ["tests", "src/notebooks"]
pythonpath = ["src/feelpp"]

# [tool.cibuildwheel]
# test-command = "pytest {project}/tests"
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ scipy
pandas
tabulate
plotly

.
27 changes: 0 additions & 27 deletions src/feelpp/ktirio/hpdaml/read.py

This file was deleted.

21 changes: 21 additions & 0 deletions src/feelpp/ktirio/hpdaml/read_case.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from vtk import *
import numpy as np

def read_case(filepath):
"""
Read the Ensight Gold case file and return the reader object
Parameters
----------
filepath : str
The path to the Ensight Gold case file
Returns
-------
reader : vtkEnSightGoldBinaryReader
The reader object
"""
reader = vtkEnSightGoldBinaryReader()
reader.SetCaseFileName(filepath)
reader.Update()
return reader
7 changes: 3 additions & 4 deletions src/notebooks/readEnsightExample.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"source": [
"import pyvista as pv\n",
"from vtk import *\n",
"import numpy as np"
"import numpy as np\n",
"from feelpp.ktirio.hpdaml.read_case import *"
]
},
{
Expand All @@ -21,9 +22,7 @@
"#NOTE: It can be directly fetched from CKAN via its REST API. ( can be slow depending on connection )\n",
"filepath = \"./strasbourg_sm_lod1/City_Energy_Modeling.case\"\n",
"\n",
"reader = vtkEnSightGoldBinaryReader()\n",
"reader.SetCaseFileName(filepath)\n",
"reader.Update()"
"reader = read_case(filepath)"
]
},
{
Expand Down

0 comments on commit ddb89d5

Please sign in to comment.