LabTools3 1.1.3.20__tar.gz → 1.1.3.22__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.
@@ -1571,6 +1571,7 @@ class histo2d:
1571
1571
 
1572
1572
  """
1573
1573
  nz = self.bin_content>0.
1574
+ # nz = self.bin_content!=0.
1574
1575
  self.logz = logz
1575
1576
  self.zmin = self.bin_content[nz].min()
1576
1577
  colormap_l = copy.copy(colormap)
@@ -1957,6 +1958,7 @@ class histo2d:
1957
1958
  return (np.searchsorted(bins, x) - 1 )
1958
1959
 
1959
1960
  def __add__(self, v):
1961
+ #print('__add__', v)
1960
1962
  # add 2 histograms and take care of the errors
1961
1963
  # check the shapes
1962
1964
  if np.isscalar(v):
@@ -1979,6 +1981,7 @@ class histo2d:
1979
1981
  return None
1980
1982
 
1981
1983
  def __sub__(self, v):
1984
+ #print('__sub__', v)
1982
1985
  # subtract 2 histograms and take care of the errors
1983
1986
  # check the shapes
1984
1987
  if np.isscalar(v):
@@ -2001,12 +2004,13 @@ class histo2d:
2001
2004
  return None
2002
2005
 
2003
2006
  def __mul__(self, v):
2007
+ #print('__mul__', v)
2004
2008
  # histogram multiply from left
2005
2009
  if np.isscalar(v):
2006
- res0 = v*self.res[0]
2010
+ res0 = v*self.bin_content
2007
2011
  err = v*self.bin_error
2008
2012
  res1 = np.copy(self.res[1])
2009
- res2 = np.copy(self.res[1])
2013
+ res2 = np.copy(self.res[2])
2010
2014
  res = ([res0, res1, res2 ])
2011
2015
  return histo2d(histogram = res, bin_error = err)
2012
2016
  elif np.array_equal(self.bin_content.shape, v.bin_content.shape):
@@ -2024,13 +2028,14 @@ class histo2d:
2024
2028
  return None
2025
2029
 
2026
2030
  def __truediv__(self, v):
2031
+ #print('__truediv__', v)
2027
2032
  # divide 2 histograms and take care of the errors
2028
2033
  # check the shapes
2029
2034
  if np.isscalar(v):
2030
- res0 = self.res[0]/v
2035
+ res0 = self.bin_content/v
2031
2036
  err = self.bin_error/v
2032
2037
  res1 = np.copy(self.res[1])
2033
- res2 = np.copy(self.res[1])
2038
+ res2 = np.copy(self.res[2])
2034
2039
  res = ([res0, res1, res2 ])
2035
2040
  return histo2d(histogram = res, bin_error = err)
2036
2041
  elif np.array_equal(self.bin_content.shape, v.bin_content.shape):
@@ -2050,6 +2055,7 @@ class histo2d:
2050
2055
 
2051
2056
 
2052
2057
  def __radd__(self, v):
2058
+ #print('__radd__', v)
2053
2059
  # add 2 histograms and take care of the errors
2054
2060
  # check the shapes
2055
2061
  if np.isscalar(v):
@@ -2072,10 +2078,11 @@ class histo2d:
2072
2078
  return None
2073
2079
 
2074
2080
  def __rsub__(self, v):
2081
+ #print('__rsub__', v)
2075
2082
  # subtract 2 histograms and take care of the errors
2076
2083
  # check the shapes
2077
2084
  if np.isscalar(v):
2078
- res0 = self.bin_content - v
2085
+ res0 = v - self.bin_content
2079
2086
  err = self.bin_error
2080
2087
  res1 = np.copy(self.res[1])
2081
2088
  res2 = np.copy(self.res[2])
@@ -2083,7 +2090,7 @@ class histo2d:
2083
2090
  return histo2d(histogram = res, bin_error = err)
2084
2091
  elif np.array_equal(self.bin_content.shape, v.bin_content.shape):
2085
2092
  # this is the content
2086
- res0 = self.bin_content - v.bin_content
2093
+ res0 = v.bin_content - self.bin_content
2087
2094
  err = np.sqrt( self.bin_error**2 + v.bin_error**2)
2088
2095
  res1 = np.copy(v.res[1])
2089
2096
  res2 = np.copy(v.res[2])
@@ -2094,12 +2101,13 @@ class histo2d:
2094
2101
  return None
2095
2102
 
2096
2103
  def __rmul__(self, v):
2104
+ #print('__rmul__', v)
2097
2105
  # histogram multiply from left
2098
2106
  if np.isscalar(v):
2099
- res0 = v*self.res[0]
2107
+ res0 = v*self.bin_content
2100
2108
  err = v*self.bin_error
2101
2109
  res1 = np.copy(self.res[1])
2102
- res2 = np.copy(self.res[1])
2110
+ res2 = np.copy(self.res[2])
2103
2111
  res = ([res0, res1, res2 ])
2104
2112
  return histo2d(histogram = res, bin_error = err)
2105
2113
  elif np.array_equal(self.bin_content.shape, v.bin_content.shape):
@@ -2118,13 +2126,14 @@ class histo2d:
2118
2126
 
2119
2127
 
2120
2128
  def __rtruediv__(self, v):
2129
+ #print('_rtuediv__', v)
2121
2130
  # divide 2 histograms and take care of the errors
2122
2131
  # check the shapes
2123
2132
  if np.isscalar(v):
2124
- res0 = v/self.res[0]
2125
- err = v/self.res[0]**2*self.bin_error
2133
+ res0 = v/self.bin_content
2134
+ err = v/self.bin_content**2*self.bin_error
2126
2135
  res1 = np.copy(self.res[1])
2127
- res2 = np.copy(self.res[1])
2136
+ res2 = np.copy(self.res[2])
2128
2137
  res = ([res0, res1, res2 ])
2129
2138
  return histo2d(histogram = res, bin_error = err)
2130
2139
  elif np.array_equal(self.bin_content.shape, v.bin_content.shape):
@@ -333,11 +333,11 @@ class dfile:
333
333
  # now try to convert according to the format
334
334
  try:
335
335
  if fc == 'f':
336
- f.append(float(k)) # create a float
336
+ f.append(float(eval(k))) # create a float
337
337
  if fc == 'i':
338
- f.append(int(k)) # create an integer
338
+ f.append(int(eval(k))) # create an integer
339
339
  if fc == 's':
340
- f.append(k) # leave as string
340
+ f.append(eval(k)) # leave as string
341
341
  except:
342
342
  f.append(k) # if not possible leave it,
343
343
  # but make a comment
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LabTools3
3
- Version: 1.1.3.20
3
+ Version: 1.1.3.22
4
4
  Summary: Python 3 Package of modules for typical analysis tasks analyzing physics data
5
5
  Home-page: http://wanda.fiu.edu/LabTools3
6
6
  Author: Werner Boeglin
@@ -72,4 +72,8 @@ Version 1.1.3.18: Added plot_guess function to histo. This makes it easy to plot
72
72
 
73
73
  Version 1.1.3.19: Fixed but when using using the fill function in 1d histograms with weights multiple times.
74
74
 
75
- Version 1.1.3.20: Added show_header to datafile and teh full_precision key word to write_csv.
75
+ Version 1.1.3.20: Added show_header to datafile and the full_precision key word to write_csv.
76
+
77
+ Version 1.1.3.21: Fixed bug in histo2d operations
78
+
79
+ Version 1.1.3.22: Updated datafile to be able to read new nunmpy output of numbers with types
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LabTools3
3
- Version: 1.1.3.20
3
+ Version: 1.1.3.22
4
4
  Summary: Python 3 Package of modules for typical analysis tasks analyzing physics data
5
5
  Home-page: http://wanda.fiu.edu/LabTools3
6
6
  Author: Werner Boeglin
@@ -72,4 +72,8 @@ Version 1.1.3.18: Added plot_guess function to histo. This makes it easy to plot
72
72
 
73
73
  Version 1.1.3.19: Fixed but when using using the fill function in 1d histograms with weights multiple times.
74
74
 
75
- Version 1.1.3.20: Added show_header to datafile and teh full_precision key word to write_csv.
75
+ Version 1.1.3.20: Added show_header to datafile and the full_precision key word to write_csv.
76
+
77
+ Version 1.1.3.21: Fixed bug in histo2d operations
78
+
79
+ Version 1.1.3.22: Updated datafile to be able to read new nunmpy output of numbers with types
@@ -47,4 +47,8 @@ Version 1.1.3.18: Added plot_guess function to histo. This makes it easy to plot
47
47
 
48
48
  Version 1.1.3.19: Fixed but when using using the fill function in 1d histograms with weights multiple times.
49
49
 
50
- Version 1.1.3.20: Added show_header to datafile and teh full_precision key word to write_csv.
50
+ Version 1.1.3.20: Added show_header to datafile and the full_precision key word to write_csv.
51
+
52
+ Version 1.1.3.21: Fixed bug in histo2d operations
53
+
54
+ Version 1.1.3.22: Updated datafile to be able to read new nunmpy output of numbers with types
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setup(
7
7
  name = "LabTools3",
8
- version = "1.1.3.20",
8
+ version = "1.1.3.22",
9
9
  packages = find_packages(),
10
10
  # add additional files
11
11
  package_data = {'':['*.bat','*.command']},
File without changes
File without changes
File without changes