Skip to content

Commit 475306c

Browse files
committed
Checking version
1 parent d8ba07e commit 475306c

10 files changed

Lines changed: 305 additions & 12 deletions

File tree

dapi/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,13 @@ def _get_version():
9090
import tomli as tomllib # Use tomli and alias it as tomllib
9191

9292
try:
93+
<<<<<<< Updated upstream
9394
pyproject_path = Path(__file__).parent / "pyproject.toml"
9495
with open(pyproject_path, "rb") as f: # tomllib expects bytes
96+
=======
97+
pyproject_path = Path(__file__).parent.parent / "pyproject.toml"
98+
with open(pyproject_path, "rb") as f: # tomllib expects bytes
99+
>>>>>>> Stashed changes
95100
data = tomllib.load(f)
96101
return data["tool"]["poetry"]["version"]
97102
except (FileNotFoundError, KeyError, ImportError, tomllib.TOMLDecodeError):

examples/mpm/mpm-minimal.ipynb

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"name": "stdout",
2727
"output_type": "stream",
2828
"text": [
29+
<<<<<<< Updated upstream
2930
"Obtaining file:///Users/krishna/dev/DesignSafe/dapi\n",
3031
" Installing build dependencies ... \u001b[?25ldone\n",
3132
"\u001b[?25h Checking if build backend supports build_editable ... \u001b[?25ldone\n",
@@ -111,12 +112,18 @@
111112
" Successfully uninstalled dapi-0.4.2\n",
112113
"Successfully installed dapi-0.4.2\n",
113114
"\n",
115+
=======
116+
"\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
117+
"poetry 2.1.3 requires importlib-metadata<8.7,>=4.4; python_version < \"3.10\", but you have importlib-metadata 8.7.0 which is incompatible.\u001b[0m\u001b[31m\n",
118+
"\u001b[0m\n",
119+
>>>>>>> Stashed changes
114120
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m25.1.1\u001b[0m\n",
115121
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n"
116122
]
117123
}
118124
],
119125
"source": [
126+
<<<<<<< Updated upstream
120127
"# Dapi installation\n",
121128
"#!pip uninstall dapi --yes\n",
122129
"\n",
@@ -127,6 +134,36 @@
127134
"\n",
128135
"# Install editable local version of dapi\n",
129136
"#!pip install -e ../../"
137+
=======
138+
"!pip install --upgrade --ignore-installed --no-cache-dir --user --quiet dapi"
139+
]
140+
},
141+
{
142+
"cell_type": "code",
143+
"execution_count": null,
144+
"id": "64e3f3a3",
145+
"metadata": {},
146+
"outputs": [],
147+
"source": [
148+
"import sys, os\n",
149+
"\n",
150+
"print(\n",
151+
" \"Old NumPy 1.24 installed!\"\n",
152+
" if sys.version_info < (3, 10)\n",
153+
" and os.system(\"pip install --user --force-reinstall numpy~=1.24.0 --quiet\") == 0\n",
154+
" else \"Skipped (Python 3.10+)\"\n",
155+
" if sys.version_info >= (3, 10)\n",
156+
" else \"Install failed!\"\n",
157+
")"
158+
]
159+
},
160+
{
161+
"cell_type": "markdown",
162+
"id": "b9fe1a7a",
163+
"metadata": {},
164+
"source": [
165+
"### ⚠️ Please restart the kernel by choosing Kernel >> Restart kernel ⚠️"
166+
>>>>>>> Stashed changes
130167
]
131168
},
132169
{
@@ -171,14 +208,25 @@
171208
]
172209
},
173210
{
211+
<<<<<<< Updated upstream
212+
=======
213+
"cell_type": "markdown",
214+
"id": "e4ac6312",
215+
"metadata": {},
216+
"source": [
217+
"### MPM Job configuration"
218+
]
219+
},
220+
{
221+
>>>>>>> Stashed changes
174222
"cell_type": "code",
175-
"execution_count": 3,
223+
"execution_count": null,
176224
"id": "feee3ce0",
177225
"metadata": {},
178226
"outputs": [],
179227
"source": [
180228
"# Job configuration parameters\n",
181-
"ds_path: str = \"/MyData/mpm-benchmarks/2d/uniaxial_stress/\" # Path to input files\n",
229+
"ds_path: str = \"/CommunityData/dapi/mpm/uniaxial_stress/\" # Path to input files\n",
182230
"input_filename: str = \"mpm.json\" # Main input script filename\n",
183231
"max_job_minutes: int = 10 # Maximum runtime in minutes\n",
184232
"tacc_allocation: str = \"ASC25049\" # TACC allocation to charge\n",

examples/mpm/mpm.ipynb

Lines changed: 89 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
}
3636
],
3737
"source": [
38+
<<<<<<< Updated upstream
3839
"# Dapi installation\n",
3940
"# !pip uninstall dapi --yes\n",
4041
"!pip install --user --ignore-installed dapi==0.4.2\n",
@@ -45,10 +46,14 @@
4546
"\n",
4647
"# Install editable local version of dapi\n",
4748
"# !pip install -e ../../"
49+
=======
50+
"!pip install --user --upgrade --force-reinstall --ignore-installed --no-cache-dir dapi --quiet"
51+
>>>>>>> Stashed changes
4852
]
4953
},
5054
{
5155
"cell_type": "code",
56+
<<<<<<< Updated upstream
5257
"execution_count": 1,
5358
"id": "ad634b9b",
5459
"metadata": {},
@@ -66,12 +71,75 @@
6671
"output_type": "stream",
6772
"text": [
6873
"unknown\n"
74+
=======
75+
"execution_count": null,
76+
"id": "c318e131",
77+
"metadata": {},
78+
"outputs": [
79+
{
80+
"name": "stdout",
81+
"output_type": "stream",
82+
"text": [
83+
"Old NumPy 1.24 installed!\n"
84+
]
85+
},
86+
{
87+
"name": "stderr",
88+
"output_type": "stream",
89+
"text": [
90+
"\n",
91+
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m25.1.1\u001b[0m\n",
92+
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n"
93+
>>>>>>> Stashed changes
6994
]
7095
}
7196
],
7297
"source": [
98+
<<<<<<< Updated upstream
7399
"import dapi\n",
74100
"print(dapi.__version__)"
101+
=======
102+
"import sys, os\n",
103+
"\n",
104+
"print(\n",
105+
" \"Old NumPy 1.24 installed!\"\n",
106+
" if sys.version_info < (3, 10)\n",
107+
" and os.system(\"pip install --user --force-reinstall numpy~=1.24.0 --quiet\") == 0\n",
108+
" else \"Skipped (Python 3.10+)\"\n",
109+
" if sys.version_info >= (3, 10)\n",
110+
" else \"Install failed!\"\n",
111+
")"
112+
]
113+
},
114+
{
115+
"cell_type": "markdown",
116+
"id": "1d36c1fb",
117+
"metadata": {},
118+
"source": [
119+
"### ⚠️ Please restart the kernel by choosing Kernel >> Restart kernel ⚠️"
120+
]
121+
},
122+
{
123+
"cell_type": "code",
124+
"execution_count": 5,
125+
"id": "8186b2c9",
126+
"metadata": {},
127+
"outputs": [
128+
{
129+
"name": "stdout",
130+
"output_type": "stream",
131+
"text": [
132+
"NumPy version: 2.0.2\n",
133+
"DAPI version: unknown\n"
134+
]
135+
}
136+
],
137+
"source": [
138+
"import numpy as np\n",
139+
"print(\"NumPy version:\", np.__version__)\n",
140+
"import dapi\n",
141+
"print(\"DAPI version:\", dapi.__version__)"
142+
>>>>>>> Stashed changes
75143
]
76144
},
77145
{
@@ -142,19 +210,30 @@
142210
]
143211
},
144212
{
213+
<<<<<<< Updated upstream
214+
=======
215+
"cell_type": "markdown",
216+
"id": "da76f536",
217+
"metadata": {},
218+
"source": [
219+
"### Configure MPM job"
220+
]
221+
},
222+
{
223+
>>>>>>> Stashed changes
145224
"cell_type": "code",
146-
"execution_count": 4,
225+
"execution_count": null,
147226
"id": "feee3ce0",
148227
"metadata": {},
149228
"outputs": [],
150229
"source": [
151-
"ds_path: str = \"/MyData/mpm-benchmarks/2d/uniaxial_stress/\"\n",
152-
"input_filename: str = \"mpm.json\"\n",
153-
"max_job_minutes: int = 10\n",
154-
"# queue: str = \"skx\" # Example override - only if needed and valid\n",
155-
"# tacc_allocation: str = \"BCS20003\"\n",
156-
"tacc_allocation: str = \"ASC25049\"\n",
157-
"app_id_to_use = \"mpm-s3\""
230+
"# Job configuration parameters\n",
231+
"ds_path: str = \"/CommunityData/dapi/mpm/uniaxial_stress/\" # Path to input files\n",
232+
"input_filename: str = \"mpm.json\" # Main input script filename\n",
233+
"max_job_minutes: int = 10 # Maximum runtime in minutes\n",
234+
"tacc_allocation: str = \"ASC25049\" # TACC allocation to charge\n",
235+
"app_id_to_use = \"mpm-s3\" # MPM application ID\n",
236+
"# queue: str = \"skx\" # Example override - only if needed and valid"
158237
]
159238
},
160239
{
@@ -183,7 +262,7 @@
183262
},
184263
{
185264
"cell_type": "code",
186-
"execution_count": 6,
265+
"execution_count": null,
187266
"id": "6257d31a",
188267
"metadata": {},
189268
"outputs": [
@@ -251,6 +330,7 @@
251330
" script_filename=input_filename,\n",
252331
" max_minutes=max_job_minutes,\n",
253332
" allocation=tacc_allocation,\n",
333+
" # queue=queue, # Uncomment if you want to specify a queue\n",
254334
" )\n",
255335
" print(\"\\n--- Generated Job Request Dictionary ---\")\n",
256336
" print(json.dumps(job_dict, indent=2, default=str))\n",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"node_sets": [
3+
{
4+
"id": 0,
5+
"set": [0, 1]
6+
},
7+
{
8+
"id": 1,
9+
"set": [2, 3]
10+
}
11+
]
12+
13+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#! elementShape quadrilateral
2+
#! elementNumPoints 4
3+
4 1
4+
0 0
5+
1.0000 0
6+
1.0000 1.0000
7+
0 1.0000
8+
0 1 2 3
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"title": "Element test",
3+
"mesh": {
4+
"mesh": "mesh.txt",
5+
"entity_sets": "entity_sets.json",
6+
"cell_type": "ED2Q4",
7+
"isoparametric": false,
8+
"io_type": "Ascii2D",
9+
"node_type": "N2D",
10+
"boundary_conditions": {
11+
"velocity_constraints": [
12+
{
13+
"nset_id" : 0,
14+
"dir": 1,
15+
"velocity": 0.00
16+
},
17+
{
18+
"nset_id" : 1,
19+
"dir": 1,
20+
"velocity": -0.01
21+
}
22+
]
23+
}
24+
},
25+
"particles": [
26+
{
27+
"generator": {
28+
"check_duplicates": true,
29+
"location": "particles.txt",
30+
"io_type": "Ascii2D",
31+
"pset_id": 0,
32+
"particle_type": "P2D",
33+
"material_id": 0,
34+
"type": "file"
35+
}
36+
}
37+
],
38+
"materials": [
39+
{
40+
"id": 0,
41+
"type": "LinearElastic2D",
42+
"density": 1,
43+
"youngs_modulus": 1000,
44+
"poisson_ratio": 0.0
45+
}
46+
],
47+
"external_loading_conditions": {
48+
"gravity": [0, 0]
49+
},
50+
"analysis": {
51+
"type": "MPMExplicit2D",
52+
"stress_update": "usf",
53+
"dt": 0.01,
54+
"uuid": "uniaxial-stress-2d-usf",
55+
"nsteps": 10,
56+
"resume": {
57+
"resume": false,
58+
"uuid": "uniaxial-stress-2d-usf",
59+
"step": 5
60+
}
61+
},
62+
"post_processing": {
63+
"path": "results/",
64+
"output_steps": 1
65+
}
66+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
4
2+
0.25 0.25
3+
0.75 0.25
4+
0.75 0.75
5+
0.25 0.75

0 commit comments

Comments
 (0)