fits2tmp 0.1.5__tar.gz → 0.1.7__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fits2tmp
3
- Version: 0.1.5
3
+ Version: 0.1.7
4
4
  Summary: A way of loading FITS files into temporary filesystems to make them available in memory.
5
5
  Home-page: https://gitlab.developers.cam.ac.uk/phy/ra/vla22-phd/fits2tmp
6
6
  License: BSD-3-Clause
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "fits2tmp"
3
- version = "0.1.5"
3
+ version = "0.1.7"
4
4
  description = "A way of loading FITS files into temporary filesystems to make them available in memory."
5
5
  license = "BSD-3-Clause"
6
6
  authors = ["Verity Allan <vla22@cam.ac.uk>"]
@@ -4,13 +4,12 @@ import json
4
4
  from astropy.io import fits
5
5
  from astropy import wcs
6
6
  import dask.array as da
7
+ from dask.distributed import Lock
7
8
  import numpy as np
8
9
  import os
9
10
  import dask
10
11
  import tempfile
11
12
 
12
- print("stoat")
13
-
14
13
  def arr_size_check(source_arr, desired_arr: tuple) -> bool:
15
14
  if len(source_arr.shape) < len(desired_arr):
16
15
  raise ValueError("You've asked for an array with more dimensions than the array stored")
@@ -63,7 +62,9 @@ def fun(darr, destination, header, block_info=None):
63
62
  out = fits.PrimaryHDU(data=darr, header=n_header)
64
63
  outpath = destination.name + '/' + block_id + ".fits"
65
64
  out.writeto(outpath)
66
- filepath.append(outpath)
65
+ lock = Lock()
66
+ with lock:
67
+ filepath.append(outpath)
67
68
  return darr
68
69
 
69
70
  def fits2tmpfiles(inputpath, destination, chunks):
@@ -73,6 +74,7 @@ def fits2tmpfiles(inputpath, destination, chunks):
73
74
  # TODO overlap
74
75
  de = da.overlap.overlap(d, depth=None, boundary=None)
75
76
  da.map_blocks(fun, d, destination, f[0].header, dtype=float).compute()
77
+ print(filepath)
76
78
 
77
79
  return filepath
78
80
 
File without changes
File without changes