Myosotis-Researches 0.0.21__py3-none-any.whl → 0.0.23__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,5 +2,6 @@ from .print_hdf5_structure import print_hdf5_structure
2
2
  from .concat_image_horizontal import concat_image_horizontal
3
3
  from .concat_image_vertical import concat_image_vertical
4
4
  from .make_h5 import make_h5
5
+ from .install_datasets import install_datasets
5
6
 
6
- __all__ = ["print_hdf5_structure", "concat_image_horizontal", "concat_image_vertical", "make_h5"]
7
+ __all__ = ["print_hdf5_structure", "concat_image_horizontal", "concat_image_vertical", "make_h5", "install_datasets"]
@@ -1,15 +1,18 @@
1
1
  import gdown
2
+ import getpass
2
3
  from importlib import resources
3
4
  import os
4
- import rarfile
5
+ import subprocess
5
6
 
6
7
  # Paths
7
8
  datasets_dir = resources.files("myosotis_researches").joinpath("CcGAN", "datasets")
9
+ if not os.path.exists(datasets_dir):
10
+ os.makedirs(datasets_dir, exist_ok=True)
8
11
 
9
12
  # File ID dictionary
10
13
  file_id_dict = {
11
- "Ra": "1DJfpvXTX1x6Ldf4nZzqzlVsQSx9iXo9I",
12
- "MNIST": "1ZmTSX_wl68nsQI0ImfhpIsPClW_QrK1T",
14
+ "Ra": "1CcXp7ga4Ebj7XeMA_fYH2RxTMOWvA0v5",
15
+ "MNIST": "1LCQmQEBAGBI7ouBEWvIAjGKZsKcYasoe",
13
16
  }
14
17
 
15
18
 
@@ -29,12 +32,12 @@ def install_datasets(datasets_name):
29
32
  gdown.download(url, zipped_dataset_path, quiet=False, use_cookies=False)
30
33
 
31
34
  # Unzip
32
- with rarfile.RarFile(zipped_dataset_path) as rf:
33
- if rf.needs_password():
34
- unzip_password = input("Password: ")
35
- rf.extractall(path=datasets_dir, pwd=unzip_password)
36
- else:
37
- rf.extractall(path=datasets_dir)
35
+ unzip_password = getpass.getpass("Password:")
36
+ cmd = ["unrar", "x", f"-p{unzip_password}", zipped_dataset_path, datasets_dir]
37
+ try:
38
+ subprocess.run(cmd, check=True)
39
+ except subprocess.CalledProcessError as e:
40
+ print(e)
38
41
 
39
42
  # Delete zipped datasets
40
43
  os.remove(zipped_dataset_path)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Myosotis-Researches
3
- Version: 0.0.21
3
+ Version: 0.0.23
4
4
  Summary: A repository for storing my progress of researches.
5
5
  Home-page: https://github.com/Zeyu-Xie/Myosotis-Researches
6
6
  Author: Zeyu Xie
@@ -40,14 +40,14 @@ myosotis_researches/CcGAN/train_128_output_10/train_cgan.py,sha256=bYJbBskTpESfC
40
40
  myosotis_researches/CcGAN/train_128_output_10/train_cgan_concat.py,sha256=PYctY3IZiHGh4TshXx3mUZBf9su_8NuV_D8InkxKQZ4,8940
41
41
  myosotis_researches/CcGAN/train_128_output_10/train_net_for_label_embed.py,sha256=4j6r4_o4rXgAN4MdUQL-TXqZJpbhH7d9gWQR8YzBlXw,6976
42
42
  myosotis_researches/CcGAN/train_128_output_10/utils.py,sha256=B-V6ct4WDisVVCOLO0W7VIBL8StPVNJJTZZ2b2NkMFU,3766
43
- myosotis_researches/CcGAN/utils/__init__.py,sha256=Pu9COV4zcXHGXuczhObersyeshVChmlEtwqp8VLUDxw,300
43
+ myosotis_researches/CcGAN/utils/__init__.py,sha256=lRNFmDmH34GK-Zc6YBdHzBVlMNUYnZdFZQAoo4jUUGg,367
44
44
  myosotis_researches/CcGAN/utils/concat_image_horizontal.py,sha256=e6WsfO9IiSoP8zkZNz7IGimPUASr9VvyJUJdF-d40iw,954
45
45
  myosotis_researches/CcGAN/utils/concat_image_vertical.py,sha256=97-SuE8ZWpaeBm_ed6MAEaUOvtpzlYq_X3yWt4OEUTY,951
46
- myosotis_researches/CcGAN/utils/install_datasets.py,sha256=V0Wd3ZZch_xB4XOEtvHS4afYPo7Xd8Js4I003R3V3hY,1033
46
+ myosotis_researches/CcGAN/utils/install_datasets.py,sha256=1WAhrzaCsWqI6vbW0awyovU2nqAtJQAEfWOdIRPQ7Jo,1121
47
47
  myosotis_researches/CcGAN/utils/make_h5.py,sha256=Q5OW1JA35ormmsrlAJp6XdC6x0uJBRNjsE31wM3zBiI,1422
48
48
  myosotis_researches/CcGAN/utils/print_hdf5_structure.py,sha256=leaR8H3GhlX6EuIXDMh36xG2zBdV-XlJkaXBuoorl6I,320
49
- myosotis_researches-0.0.21.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
50
- myosotis_researches-0.0.21.dist-info/METADATA,sha256=h0HhhIcRU51Y07g-lPAQCADiAo9604WYQ3cPIRlBSQc,765
51
- myosotis_researches-0.0.21.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
52
- myosotis_researches-0.0.21.dist-info/top_level.txt,sha256=zxAiMn5eyZNJM28MewTAkgi_RZJMbfWbzVR-KF0LdZE,20
53
- myosotis_researches-0.0.21.dist-info/RECORD,,
49
+ myosotis_researches-0.0.23.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
50
+ myosotis_researches-0.0.23.dist-info/METADATA,sha256=T9epn3swX3TD4jLZ4MgDdcqp18fZwnLzYM5OhDzDaBA,765
51
+ myosotis_researches-0.0.23.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
52
+ myosotis_researches-0.0.23.dist-info/top_level.txt,sha256=zxAiMn5eyZNJM28MewTAkgi_RZJMbfWbzVR-KF0LdZE,20
53
+ myosotis_researches-0.0.23.dist-info/RECORD,,