pyuff 2.5.2__tar.gz → 2.5.4__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.4
2
2
  Name: pyuff
3
- Version: 2.5.2
3
+ Version: 2.5.4
4
4
  Summary: UFF (Universal File Format) read/write.
5
5
  Project-URL: homepage, https://github.com/ladisk/pyuff
6
6
  Project-URL: documentation, https://pyuff.readthedocs.io/en/latest/
@@ -15,7 +15,7 @@ Classifier: Intended Audience :: Developers
15
15
  Classifier: License :: OSI Approved :: MIT License
16
16
  Classifier: Programming Language :: Python :: 3.10
17
17
  Classifier: Topic :: Scientific/Engineering
18
- Requires-Python: >=3.10
18
+ Requires-Python: >=3.11
19
19
  Requires-Dist: numpy
20
20
  Provides-Extra: dev
21
21
  Requires-Dist: build; extra == 'dev'
@@ -36,7 +36,7 @@ Universal File Format read and write
36
36
  ------------------------------------
37
37
  This module defines an UFF class to manipulate with the UFF (Universal File Format) files.
38
38
 
39
- Read from and write of data-set types **15, 55, 58, 58b, 82, 151, 164, 2411, 2412, 2414, 2420, 2429, 2467** are supported.
39
+ Read from and write of data-set types **15, 55, 58, 58b, 82, 151, 164, 1858, 2411, 2412, 2414, 2420, 2429, 2467** are supported.
40
40
 
41
41
  Check out the `documentation <https://pyuff.readthedocs.io/en/latest/index.html>`_.
42
42
 
@@ -7,7 +7,7 @@ Universal File Format read and write
7
7
  ------------------------------------
8
8
  This module defines an UFF class to manipulate with the UFF (Universal File Format) files.
9
9
 
10
- Read from and write of data-set types **15, 55, 58, 58b, 82, 151, 164, 2411, 2412, 2414, 2420, 2429, 2467** are supported.
10
+ Read from and write of data-set types **15, 55, 58, 58b, 82, 151, 164, 1858, 2411, 2412, 2414, 2420, 2429, 2467** are supported.
11
11
 
12
12
  Check out the `documentation <https://pyuff.readthedocs.io/en/latest/index.html>`_.
13
13
 
@@ -4,14 +4,14 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "pyuff"
7
- version = "2.5.2"
7
+ version = "2.5.4"
8
8
  authors = [{name = "Primož Čermelj, Janko Slavič", email = "janko.slavic@fs.uni-lj.si"}]
9
9
  maintainers = [{name = "Janko Slavič et al.", email = "janko.slavic@fs.uni-lj.si"}]
10
10
  license = "MIT"
11
11
  description = "UFF (Universal File Format) read/write."
12
12
  readme = "README.rst"
13
13
  keywords = ['UFF', 'UNV', 'Universal File Format', 'read/write']
14
- requires-python = ">=3.10"
14
+ requires-python = ">=3.11"
15
15
  dependencies = [
16
16
  "numpy",
17
17
  ]
@@ -1,4 +1,4 @@
1
- __version__ = "2.5.2"
1
+ __version__ = "2.5.4"
2
2
  from .pyuff import *
3
3
  from .datasets import *
4
4
 
@@ -672,18 +672,18 @@ def prepare_55(
672
672
  raise ValueError('data_type can be 2:Real or 5:Complex')
673
673
  if np.array(n_data_per_node).dtype != int and n_data_per_node != None:
674
674
  raise TypeError('n_data_per_node must be integers')
675
- if np.array(r1).dtype != float and r1 != None:
676
- raise TypeError('r1 must have float values')
677
- if np.array(r2).dtype != float and r2 != None:
678
- raise TypeError('r2 must have float values')
679
- if np.array(r3).dtype != float and r3 != None:
680
- raise TypeError('r3 must have float values')
681
- if np.array(r4).dtype != float and r4 != None:
682
- raise TypeError('r4 must have float values')
683
- if np.array(r5).dtype != float and r5 != None:
684
- raise TypeError('r5 must have float values')
685
- if np.array(r6).dtype != float and r6 != None:
686
- raise TypeError('r6 must have float values')
675
+ if not np.issubdtype(np.array(r1).dtype, np.number) and r1 != None:
676
+ raise TypeError('r1 must have numeric (float or complex) values')
677
+ if not np.issubdtype(np.array(r2).dtype, np.number) and r2 != None:
678
+ raise TypeError('r2 must have numeric (float or complex) values')
679
+ if not np.issubdtype(np.array(r3).dtype, np.number) and r3 != None:
680
+ raise TypeError('r3 must have numeric (float or complex) values')
681
+ if not np.issubdtype(np.array(r4).dtype, np.number) and r4 != None:
682
+ raise TypeError('r4 must have numeric (float or complex) values')
683
+ if not np.issubdtype(np.array(r5).dtype, np.number) and r5 != None:
684
+ raise TypeError('r5 must have numeric (float or complex) values')
685
+ if not np.issubdtype(np.array(r6).dtype, np.number) and r6 != None:
686
+ raise TypeError('r6 must have numeric (float or complex) values')
687
687
  if type(load_case) != int and load_case != None:
688
688
  raise TypeError('load_case must be integer')
689
689
  if type(mode_n) != int and mode_n != None:
@@ -696,12 +696,12 @@ def prepare_55(
696
696
  raise TypeError('modal_damp_vis must be float')
697
697
  if type(modal_damp_his) != float and modal_damp_his != None:
698
698
  raise TypeError('modal_damp_his must be float')
699
- if np.array(eig).dtype != float and eig != None:
700
- raise TypeError('eig must be float')
701
- if np.array(modal_a).dtype != float and modal_a != None:
702
- raise TypeError('modal_a must be float')
703
- if np.array(modal_b).dtype != float and modal_b != None:
704
- raise TypeError('modal_b must be float')
699
+ if not np.issubdtype(np.array(eig).dtype, np.number) and eig != None:
700
+ raise TypeError('eig must be numeric (float or complex)')
701
+ if not np.issubdtype(np.array(modal_a).dtype, np.number) and modal_a != None:
702
+ raise TypeError('modal_a must be numeric (float or complex)')
703
+ if not np.issubdtype(np.array(modal_b).dtype, np.number) and modal_b != None:
704
+ raise TypeError('modal_b must be numeric (float or complex)')
705
705
  if type(freq_step_n) != int and freq_step_n != None:
706
706
  raise TypeError('freq_step_n must be int')
707
707
  if np.array(node_nums).dtype != int and node_nums != None:
@@ -902,11 +902,6 @@ def _write58(fh, dset, mode='add', _filename=None, force_double=True):
902
902
 
903
903
  # handling abscissa spacing automatically
904
904
  # is_even = len( set( [ dset['x'][ii]-dset['x'][ii-1] for ii in range(1,len(dset['x'])) ] ) ) == 1
905
- # decode utf to ascii
906
- for k, v in dset.items():
907
- if type(v) == str:
908
- dset[k] = v.encode("utf-8").decode('ascii','ignore')
909
-
910
905
  dset['abscissa_min'] = dset['x'][0]
911
906
  dx = dset['x'][1] - dset['x'][0]
912
907
  fh.write('%6i\n%6i' % (-1, 58))
@@ -977,9 +972,9 @@ def _write58(fh, dset, mode='add', _filename=None, force_double=True):
977
972
  [fh.write(struct.pack('>d', datai)) for datai in data]
978
973
  fh.close()
979
974
  if mode.lower() == 'overwrite':
980
- fh = open(_filename, 'wt')
975
+ fh = open(_filename, 'wt', encoding='utf-8')
981
976
  elif mode.lower() == 'add':
982
- fh = open(_filename, 'at')
977
+ fh = open(_filename, 'at', encoding='utf-8')
983
978
  else:
984
979
  if is_double: # write double precision
985
980
  n4_blocks = len(data) // 4
@@ -993,7 +988,7 @@ def _write58(fh, dset, mode='add', _filename=None, force_double=True):
993
988
  fh.write(n4_blocks * '%13.5e%20.11e%13.5e%20.11e\n' % tuple(data[:4 * n4_blocks]))
994
989
  if rem_vals > 0:
995
990
  fmt = ['%13.5e', '%20.11e', '%13.5e', '%20.11e']
996
- fh.write((''.join(fmt[rem_vals]) + '\n') % tuple(data[4 * n4_blocks:]))
991
+ fh.write((''.join(fmt[:rem_vals]) + '\n') % tuple(data[4 * n4_blocks:]))
997
992
  else:
998
993
  if is_even:
999
994
  fh.write(n4_blocks * '%20.11e%20.11e%20.11e%20.11e\n' % tuple(data[:4 * n4_blocks]))
@@ -416,13 +416,13 @@ class UFF:
416
416
  if mode.lower() == 'overwrite':
417
417
  # overwrite mode
418
418
  try:
419
- fh = open(self._filename, 'wt')
419
+ fh = open(self._filename, 'wt', encoding='utf-8')
420
420
  except:
421
421
  raise Exception('Cannot access the file: ' + self._filename + ' to write to.')
422
422
  elif mode.lower() == 'add':
423
423
  # add (append) mode
424
424
  try:
425
- fh = open(self._filename, 'at')
425
+ fh = open(self._filename, 'at', encoding='utf-8')
426
426
  except:
427
427
  raise Exception('Cannot access the file: ' + self._filename + ' to write to.')
428
428
  else:
File without changes
File without changes
File without changes
File without changes