Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
YuXHe15 committed Aug 11, 2023
1 parent f45dfe7 commit 72b692a
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 36 deletions.
10 changes: 7 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ freecad_appimage
amworkflow/__pycache__

# Code examples from occ-repo and written for premitive tests
examples
# examples

# Doit temp files
*.doit.*
Expand All @@ -181,5 +181,9 @@ test_main
pythonocc-utils

#db_files
usecases/*/db/
usecases/*/output/
examples/*/db/
examples/*/output/

# usecases
usecases/*
!usecases/readme.md
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Then you are good to go.

## Get started
This is a simple tutorial which get you familiar with the way of interacting with amworkflow.
1. Create a new folder in /usecase, for example test_am4, as maybe created already.
2. Create a new script am4.py. (Also maybe in the folder now.)
1. Create a new folder in /usecase, for example test_am4.
2. Create a new script am4.py. (You may also find it in examples/test_am4.)
3. simply do:
```python
from amworkflow.src.interface.api import amWorkflow as aw
Expand Down Expand Up @@ -140,7 +140,7 @@ This is a simple tutorial which get you familiar with the way of interacting wit
```

6. What if you need more parameters or different parameters?
amorkflow support changing parameters by adding a param_status in the db. In this example, let's change our parameter *radius* to *radius_1* and add a new parameter *length_0*. To achieve that, firstly you need to change parameters in the am4.py:
amorkflow supports changing parameters by adding a param_status in the db. In this example, let's change our parameter *radius* to *radius_1* and add a new parameter *length_0*. To achieve that, firstly you need to change parameters in the am4.py:
```python
from amworkflow.src.interface.api import amWorkflow as aw
@aw.engine.amworkflow()
Expand Down
4 changes: 2 additions & 2 deletions amworkflow/src/core/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ def data_init(self):
#remove certain model profile from database
query_mdl_pfl = aw.db.query_data("ModelProfile", by_name=self.args.name, column_name="model_name")
q_md5 = query_mdl_pfl.imported_file_id[0]
query_tk = aw.db.query_data("Task", self.args.name, "model_name").task_id.to_list()
aw.tool.delete(dir_path=self.args.db_file_dir, operate="list", op_list=query_tk)
if q_md5 != None:
aw.db.delete_data("ImportedFile", prim_ky=q_md5)
else:
aw.db.delete_data("ModelProfile", prim_ky=self.args.name)
query_tk = aw.db.query_data("Task", self.args.name, "model_name").task_id.to_list()
aw.tool.delete(dir_path=self.args.db_file_dir, operate="list", op_list=query_tk)
print(f"model {self.args.name} has been removed successfully.")
case 0: # do nothing, fill data into the loaded model.
query = aw.db.query_data("ParameterToProfile", by_name=self.args.name, column_name="model_name", only_for_column="param_name", snd_column_name="param_status", snd_by_name=1)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def geom_spn(pm):
#create the bottom of the basement
btm_wire = aw.geom.create_wire_by_points(pts)
btm_face = aw.geom.reverse(aw.geom.create_face(btm_wire))
# btm_face = aw.geom.create_face(btm_wire)
#create a cutter for trimming the prism.
cutter = aw.geom.create_prism(aw.geom.scale(btm_face, aw.geom.get_face_center_of_mass(btm_face,True),1.2),[0,0,-15],True)
prism = aw.geom.reverse(aw.geom.cutter3D(prism, cutter))
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions examples/test_am4/am4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from amworkflow.src.interface.api import amWorkflow as aw
@aw.engine.amworkflow()
def geometry_spawn(pm):
box = aw.geom.create_box(length=pm.length,
width= pm.width,
height=pm.height,
radius=pm.radius)
return box
File renamed without changes.
28 changes: 0 additions & 28 deletions usecases/param_wall/test2.yaml

This file was deleted.

0 comments on commit 72b692a

Please sign in to comment.