|
7 | 7 | import warnings |
8 | 8 | from ansys.dpf.core.examples.examples import find_files |
9 | 9 |
|
10 | | -EXAMPLE_REPO = "https://github.com/ansys/example-data/raw/master/result_files/" |
| 10 | +EXAMPLE_REPO = "https://github.com/ansys/example-data/raw/master/" |
11 | 11 |
|
12 | 12 |
|
13 | 13 | def delete_downloads(): |
@@ -121,7 +121,9 @@ def download_transient_result( |
121 | 121 | 'C:/Users/user/AppData/local/temp/transient.rst' |
122 | 122 |
|
123 | 123 | """ |
124 | | - return _download_file("transient", "transient.rst", should_upload, server, return_local_path) |
| 124 | + return _download_file( |
| 125 | + "result_files/transient", "transient.rst", should_upload, server, return_local_path |
| 126 | + ) |
125 | 127 |
|
126 | 128 |
|
127 | 129 | def download_all_kinds_of_complexity( |
@@ -162,7 +164,7 @@ def download_all_kinds_of_complexity( |
162 | 164 |
|
163 | 165 | """ |
164 | 166 | return _download_file( |
165 | | - "testing", "allKindOfComplexity.rst", should_upload, server, return_local_path |
| 167 | + "result_files/testing", "allKindOfComplexity.rst", should_upload, server, return_local_path |
166 | 168 | ) |
167 | 169 |
|
168 | 170 |
|
@@ -204,7 +206,7 @@ def download_all_kinds_of_complexity_modal( |
204 | 206 |
|
205 | 207 | """ |
206 | 208 | return _download_file( |
207 | | - "testing", |
| 209 | + "result_files/testing", |
208 | 210 | "modal_allKindOfComplexity.rst", |
209 | 211 | should_upload, |
210 | 212 | server, |
@@ -247,7 +249,9 @@ def download_pontoon(should_upload: bool = True, server=None, return_local_path= |
247 | 249 | 'C:/Users/user/AppData/local/temp/pontoon.rst' |
248 | 250 |
|
249 | 251 | """ |
250 | | - return _download_file("docs", "pontoon.rst", should_upload, server, return_local_path) |
| 252 | + return _download_file( |
| 253 | + "result_files/docs", "pontoon.rst", should_upload, server, return_local_path |
| 254 | + ) |
251 | 255 |
|
252 | 256 |
|
253 | 257 | def download_multi_harmonic_result( |
@@ -287,7 +291,7 @@ def download_multi_harmonic_result( |
287 | 291 | 'C:/Users/user/AppData/local/temp/file_harmonic_5rpms.rst' |
288 | 292 | """ |
289 | 293 | return _download_file( |
290 | | - "harmonic", "file_harmonic_5rpms.rst", should_upload, server, return_local_path |
| 294 | + "result_files/harmonic", "file_harmonic_5rpms.rst", should_upload, server, return_local_path |
291 | 295 | ) |
292 | 296 |
|
293 | 297 |
|
@@ -328,7 +332,9 @@ def download_multi_stage_cyclic_result( |
328 | 332 | 'C:/Users/user/AppData/local/temp/multistage.rst' |
329 | 333 |
|
330 | 334 | """ |
331 | | - return _download_file("multistage", "multistage.rst", should_upload, server, return_local_path) |
| 335 | + return _download_file( |
| 336 | + "result_files/multistage", "multistage.rst", should_upload, server, return_local_path |
| 337 | + ) |
332 | 338 |
|
333 | 339 |
|
334 | 340 | def download_sub_file(should_upload: bool = True, server=None, return_local_path=False) -> str: |
@@ -366,7 +372,7 @@ def download_sub_file(should_upload: bool = True, server=None, return_local_path |
366 | 372 | 'C:\\Users\\user\\AppData\\Local\\ansys-dpf-core\\ansys-dpf-core\\examples\\sub\\cp56.sub' |
367 | 373 |
|
368 | 374 | """ |
369 | | - return _download_file("sub", "cp56.sub", should_upload, server, return_local_path) |
| 375 | + return _download_file("result_files/sub", "cp56.sub", should_upload, server, return_local_path) |
370 | 376 |
|
371 | 377 |
|
372 | 378 | def download_msup_files_to_dict( |
@@ -409,9 +415,15 @@ def download_msup_files_to_dict( |
409 | 415 |
|
410 | 416 | """ |
411 | 417 | return { |
412 | | - "rfrq": _download_file("msup", "file.rfrq", should_upload, server, return_local_path), |
413 | | - "mode": _download_file("msup", "file.mode", should_upload, server, return_local_path), |
414 | | - "rst": _download_file("msup", "file.rst", should_upload, server, return_local_path), |
| 418 | + "rfrq": _download_file( |
| 419 | + "result_files/msup", "file.rfrq", should_upload, server, return_local_path |
| 420 | + ), |
| 421 | + "mode": _download_file( |
| 422 | + "result_files/msup", "file.mode", should_upload, server, return_local_path |
| 423 | + ), |
| 424 | + "rst": _download_file( |
| 425 | + "result_files/msup", "file.rst", should_upload, server, return_local_path |
| 426 | + ), |
415 | 427 | } |
416 | 428 |
|
417 | 429 |
|
@@ -454,16 +466,20 @@ def download_distributed_files( |
454 | 466 |
|
455 | 467 | """ |
456 | 468 | return { |
457 | | - 0: _download_file("distributed", "file0.rst", should_upload, server, return_local_path), |
458 | | - 1: _download_file("distributed", "file1.rst", should_upload, server, return_local_path), |
| 469 | + 0: _download_file( |
| 470 | + "result_files/distributed", "file0.rst", should_upload, server, return_local_path |
| 471 | + ), |
| 472 | + 1: _download_file( |
| 473 | + "result_files/distributed", "file1.rst", should_upload, server, return_local_path |
| 474 | + ), |
459 | 475 | } |
460 | 476 |
|
461 | 477 |
|
462 | 478 | def download_fluent_multi_species_files( |
463 | 479 | should_upload: bool = True, server=None, return_local_path=False |
464 | 480 | ) -> dict: |
465 | | - """Download the cas and dat file of a fluent analysis and return the |
466 | | - download paths into a dictionary extension->path. |
| 481 | + """Download the cas and dat file of a fluent analysis with multiple species |
| 482 | + and return the download paths into a dictionary extension->path. |
467 | 483 | If the server is remote (or doesn't share memory), the file is uploaded or made available |
468 | 484 | on the server side. |
469 | 485 |
|
@@ -498,8 +514,12 @@ def download_fluent_multi_species_files( |
498 | 514 |
|
499 | 515 | """ |
500 | 516 | return { |
501 | | - "cas": _download_file("fluent", "FFF.cas.h5", should_upload, server, return_local_path), |
502 | | - "dat": _download_file("fluent", "FFF.dat.h5", should_upload, server, return_local_path), |
| 517 | + "cas": _download_file( |
| 518 | + "result_files/fluent", "FFF.cas.h5", should_upload, server, return_local_path |
| 519 | + ), |
| 520 | + "dat": _download_file( |
| 521 | + "result_files/fluent", "FFF.dat.h5", should_upload, server, return_local_path |
| 522 | + ), |
503 | 523 | } |
504 | 524 |
|
505 | 525 |
|
@@ -546,10 +566,10 @@ def download_extrapolation_3d_result( |
546 | 566 | """ |
547 | 567 | path_dict = { |
548 | 568 | "file_ref": _download_file( |
549 | | - "extrapolate", "file_ref.rst", should_upload, server, return_local_path |
| 569 | + "result_files/extrapolate", "file_ref.rst", should_upload, server, return_local_path |
550 | 570 | ), |
551 | 571 | "file_integrated": _download_file( |
552 | | - "extrapolate", "file.rst", should_upload, server, return_local_path |
| 572 | + "result_files/extrapolate", "file.rst", should_upload, server, return_local_path |
553 | 573 | ), |
554 | 574 | } |
555 | 575 |
|
@@ -599,14 +619,14 @@ def download_extrapolation_2d_result( |
599 | 619 | """ |
600 | 620 | path_dict = { |
601 | 621 | "file_ref": _download_file( |
602 | | - "extrapolate", |
| 622 | + "result_files/extrapolate", |
603 | 623 | "extrapolate_2d_ref.rst", |
604 | 624 | should_upload, |
605 | 625 | server, |
606 | 626 | return_local_path, |
607 | 627 | ), |
608 | 628 | "file_integrated": _download_file( |
609 | | - "extrapolate", |
| 629 | + "result_files/extrapolate", |
610 | 630 | "extrapolate_2d.rst", |
611 | 631 | should_upload, |
612 | 632 | server, |
@@ -652,7 +672,9 @@ def download_hemisphere(should_upload: bool = True, server=None, return_local_pa |
652 | 672 | 'C:/Users/user/AppData/local/temp/hemisphere.rst' |
653 | 673 |
|
654 | 674 | """ |
655 | | - return _download_file("hemisphere", "hemisphere.rst", should_upload, server, return_local_path) |
| 675 | + return _download_file( |
| 676 | + "result_files/hemisphere", "hemisphere.rst", should_upload, server, return_local_path |
| 677 | + ) |
656 | 678 |
|
657 | 679 |
|
658 | 680 | def download_example_asme_result( |
@@ -691,7 +713,7 @@ def download_example_asme_result( |
691 | 713 | 'C:/Users/user/AppData/local/temp/asme_example.rst' |
692 | 714 | """ |
693 | 715 | return _download_file( |
694 | | - "postprocessing", "asme_example.rst", should_upload, server, return_local_path |
| 716 | + "result_files/postprocessing", "asme_example.rst", should_upload, server, return_local_path |
695 | 717 | ) |
696 | 718 |
|
697 | 719 |
|
@@ -730,7 +752,9 @@ def download_crankshaft(should_upload: bool = True, server=None, return_local_pa |
730 | 752 | 'C:/Users/user/AppData/local/temp/crankshaft.rst' |
731 | 753 |
|
732 | 754 | """ |
733 | | - return _download_file("crankshaft", "crankshaft.rst", should_upload, server, return_local_path) |
| 755 | + return _download_file( |
| 756 | + "result_files/crankshaft", "crankshaft.rst", should_upload, server, return_local_path |
| 757 | + ) |
734 | 758 |
|
735 | 759 |
|
736 | 760 | def download_piston_rod(should_upload: bool = True, server=None, return_local_path=False) -> str: |
@@ -768,7 +792,9 @@ def download_piston_rod(should_upload: bool = True, server=None, return_local_pa |
768 | 792 | 'C:/Users/user/AppData/local/temp/piston_rod.rst' |
769 | 793 |
|
770 | 794 | """ |
771 | | - return _download_file("piston_rod", "piston_rod.rst", should_upload, server, return_local_path) |
| 795 | + return _download_file( |
| 796 | + "result_files/piston_rod", "piston_rod.rst", should_upload, server, return_local_path |
| 797 | + ) |
772 | 798 |
|
773 | 799 |
|
774 | 800 | def download_d3plot_beam(should_upload: bool = True, server=None, return_local_path=False) -> list: |
@@ -810,10 +836,18 @@ def download_d3plot_beam(should_upload: bool = True, server=None, return_local_p |
810 | 836 |
|
811 | 837 | """ |
812 | 838 | return [ |
813 | | - _download_file("d3plot_beam", "d3plot", should_upload, server, return_local_path), |
814 | | - _download_file("d3plot_beam", "d3plot01", should_upload, server, return_local_path), |
815 | | - _download_file("d3plot_beam", "d3plot02", should_upload, server, return_local_path), |
816 | | - _download_file("d3plot_beam", "file.actunits", should_upload, server, return_local_path), |
| 839 | + _download_file( |
| 840 | + "result_files/d3plot_beam", "d3plot", should_upload, server, return_local_path |
| 841 | + ), |
| 842 | + _download_file( |
| 843 | + "result_files/d3plot_beam", "d3plot01", should_upload, server, return_local_path |
| 844 | + ), |
| 845 | + _download_file( |
| 846 | + "result_files/d3plot_beam", "d3plot02", should_upload, server, return_local_path |
| 847 | + ), |
| 848 | + _download_file( |
| 849 | + "result_files/d3plot_beam", "file.actunits", should_upload, server, return_local_path |
| 850 | + ), |
817 | 851 | ] |
818 | 852 |
|
819 | 853 |
|
@@ -852,7 +886,9 @@ def download_binout_matsum(should_upload: bool = True, server=None, return_local |
852 | 886 | 'C:/Users/user/AppData/local/temp/binout_matsum' |
853 | 887 |
|
854 | 888 | """ |
855 | | - return _download_file("binout", "binout_matsum", should_upload, server, return_local_path) |
| 889 | + return _download_file( |
| 890 | + "result_files/binout", "binout_matsum", should_upload, server, return_local_path |
| 891 | + ) |
856 | 892 |
|
857 | 893 |
|
858 | 894 | def download_binout_glstat(should_upload: bool = True, server=None, return_local_path=False) -> str: |
@@ -890,7 +926,9 @@ def download_binout_glstat(should_upload: bool = True, server=None, return_local |
890 | 926 | 'C:/Users/user/AppData/local/temp/binout_glstat' |
891 | 927 |
|
892 | 928 | """ |
893 | | - return _download_file("binout", "binout_glstat", should_upload, server, return_local_path) |
| 929 | + return _download_file( |
| 930 | + "result_files/binout", "binout_glstat", should_upload, server, return_local_path |
| 931 | + ) |
894 | 932 |
|
895 | 933 |
|
896 | 934 | def download_cycles_to_failure( |
@@ -931,7 +969,7 @@ def download_cycles_to_failure( |
931 | 969 |
|
932 | 970 | """ |
933 | 971 | return _download_file( |
934 | | - "cyclic", "cyclic_to_failure.rst", should_upload, server, return_local_path |
| 972 | + "result_files/cyclic", "cyclic_to_failure.rst", should_upload, server, return_local_path |
935 | 973 | ) |
936 | 974 |
|
937 | 975 |
|
@@ -968,7 +1006,9 @@ def download_modal_frame(should_upload: bool = True, server=None, return_local_p |
968 | 1006 | >>> path = examples.download_modal_frame() |
969 | 1007 |
|
970 | 1008 | """ |
971 | | - return _download_file("modal", "frame.rst", should_upload, server, return_local_path) |
| 1009 | + return _download_file( |
| 1010 | + "result_files/modal", "frame.rst", should_upload, server, return_local_path |
| 1011 | + ) |
972 | 1012 |
|
973 | 1013 |
|
974 | 1014 | def download_harmonic_clamped_pipe( |
@@ -1006,7 +1046,9 @@ def download_harmonic_clamped_pipe( |
1006 | 1046 | >>> path = examples.download_modal_frame() |
1007 | 1047 |
|
1008 | 1048 | """ |
1009 | | - return _download_file("harmonic", "clamped_pipe.rst", should_upload, server, return_local_path) |
| 1049 | + return _download_file( |
| 1050 | + "result_files/harmonic", "clamped_pipe.rst", should_upload, server, return_local_path |
| 1051 | + ) |
1010 | 1052 |
|
1011 | 1053 |
|
1012 | 1054 | def download_modal_cyclic(should_upload: bool = True, server=None, return_local_path=False) -> str: |
@@ -1042,4 +1084,6 @@ def download_modal_cyclic(should_upload: bool = True, server=None, return_local_ |
1042 | 1084 | >>> path = examples.download_modal_cyclic() |
1043 | 1085 |
|
1044 | 1086 | """ |
1045 | | - return _download_file("cyclic", "modal_cyclic.rst", should_upload, server, return_local_path) |
| 1087 | + return _download_file( |
| 1088 | + "result_files/cyclic", "modal_cyclic.rst", should_upload, server, return_local_path |
| 1089 | + ) |
0 commit comments