File tree 2 files changed +42
-0
lines changed
2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -134,3 +134,4 @@ input.py.dat
134
134
* .cube
135
135
dfh. *
136
136
* .npz
137
+ * .zip
Original file line number Diff line number Diff line change
1
+ import gau2grid as gg
2
+ from pathlib import Path
3
+ import os
4
+ import zipfile
5
+ import tempfile
6
+ import shutil
7
+
8
+ am_list = [6 , 8 ]
9
+
10
+ for am in am_list :
11
+
12
+ folder = f"gau2grid-am{ am } -{ gg .__version__ } "
13
+ zip_filename = folder + '.zip'
14
+ zipf = zipfile .ZipFile (zip_filename , 'w' , zipfile .ZIP_DEFLATED )
15
+
16
+ path = Path (folder )
17
+ path .mkdir (parents = True )
18
+ gg .c_gen .generate_c_gau2grid (am , path = path .resolve ())
19
+
20
+ for filename in path .iterdir ():
21
+ zipf .write (filename )
22
+
23
+ shutil .rmtree (path .resolve ())
24
+
25
+ # with tempfile.TemporaryDirectory() as tmp:
26
+ # os.chdir(tmp)
27
+ #
28
+ # folder = f"gau2grid-am{am}-{gg.__version__}"
29
+ # zip_filename = folder + '.zip'
30
+ # zip_path = os.path.join(tmp, zip_filename)
31
+ # zipf = zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED)
32
+ #
33
+ # path = Path(tmp) / folder
34
+ # path.mkdir(parents=True)
35
+ # gg.c_gen.generate_c_gau2grid(am, path=path.resolve())
36
+ #
37
+ # for filename in path.iterdir():
38
+ # arcname = os.path.join(*str(filename).split(os.path.sep)[-2:])
39
+ # print(filename, arcname)
40
+ # zipf.write(filename, arcname=arcname)
41
+ #
You can’t perform that action at this time.
0 commit comments