skinoptics 0.0.1b7__py3-none-any.whl → 0.0.1b9__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.
skinoptics/__init__.py CHANGED
@@ -36,7 +36,7 @@ __all__ = ['utils', 'dataframes',
36
36
  __version__major = '0'
37
37
  __version__minor = '0'
38
38
  __version__micro = '1'
39
- __version__suffix = 'b7'
39
+ __version__suffix = 'b9'
40
40
 
41
41
  __author__ = "Victor Lima"
42
42
  __copyright__ = "Copyright (c) 2024-2025 Victor Lima"
@@ -23,7 +23,7 @@
23
23
  | Release date:
24
24
  | October 2024
25
25
  | Last modification:
26
- | October 2024
26
+ | March 2025
27
27
 
28
28
  | References:
29
29
 
@@ -395,7 +395,7 @@ def ptheta_TTU2(theta, g1, g2, gamma):
395
395
 
396
396
  return gamma*ptheta_U2(theta = theta, g = g1) + (1 - gamma)*ptheta_U2(theta = theta, g = g2)
397
397
 
398
- def theta_R_from_RND(n_RND = int(1E6)):
398
+ def theta_R_from_RND(n_RND = int(1E6), seed_RND = None):
399
399
  r'''
400
400
  | The scattering angle distribution as a function of a set of random numbers uniformly
401
401
  | distributed over the interval [0, 1), assuming the Rayleigh scattering phase function.
@@ -409,11 +409,15 @@ def theta_R_from_RND(n_RND = int(1E6)):
409
409
 
410
410
  :param n_RND: number of random numbers [-] (default to int(1E6))
411
411
  :type n_RND: int
412
+
413
+ :param seed_RND: seed for the random number generator np.random.default_rng() [-] (default to None)
414
+ :type seed_RND: int
412
415
 
413
416
  :return: - **theta** (*np.ndarray*) – scattering angle [degrees]
414
417
  '''
415
418
 
416
- xi = np.random.rand(n_RND)
419
+ rng = np.random.default_rng(seed = seed_RND)
420
+ xi = rng.uniform(0., 1., size = n_RND)
417
421
  two_times_xi_minus_one = 2*xi - 1
418
422
  term1 = -2*two_times_xi_minus_one
419
423
  term2 = np.sqrt(4*two_times_xi_minus_one**2 + 1)
@@ -421,7 +425,7 @@ def theta_R_from_RND(n_RND = int(1E6)):
421
425
  return np.arccos(np.cbrt(term1 + term2) + np.cbrt(term1 - term2))*180/np.pi
422
426
 
423
427
 
424
- def theta_HG_from_RND(g, n_RND = int(1E6)):
428
+ def theta_HG_from_RND(g, n_RND = int(1E6), seed_RND = None):
425
429
  r'''
426
430
  | The scattering angle distribution as a function of the anisotropy factor and a set of random
427
431
  | numbers uniformly distributed over the interval [0, 1), assuming the Henyey-Greenstein
@@ -443,6 +447,9 @@ def theta_HG_from_RND(g, n_RND = int(1E6)):
443
447
 
444
448
  :param n_RND: number of random numbers [-] (default to int(1E6))
445
449
  :type n_RND: int
450
+
451
+ :param seed_RND: seed for the random number generator np.random.default_rng() [-] (default to None)
452
+ :type seed_RND: int
446
453
 
447
454
  :return: - **theta** (*np.ndarray*) – scattering angle [degrees]
448
455
  '''
@@ -451,7 +458,8 @@ def theta_HG_from_RND(g, n_RND = int(1E6)):
451
458
  msg = 'The input g = {} is out of the range [-1, 1].'.format(g)
452
459
  raise Exception(msg)
453
460
 
454
- xi = np.random.rand(n_RND)
461
+ rng = np.random.default_rng(seed = seed_RND)
462
+ xi = rng.uniform(0., 1., size = n_RND)
455
463
  if g == 0:
456
464
  theta_HG = np.arccos(2*xi - 1)*180./np.pi
457
465
  else:
@@ -459,7 +467,7 @@ def theta_HG_from_RND(g, n_RND = int(1E6)):
459
467
 
460
468
  return theta_HG
461
469
 
462
- def theta_U2_from_RND(g, n_RND = int(1E6)):
470
+ def theta_U2_from_RND(g, n_RND = int(1E6), seed_RND = None):
463
471
  r'''
464
472
  | The scattering angle distribution as a function of the g parameter and a set of random
465
473
  | numbers uniformly distributed over the interval [0, 1), assuming the Ultraspherical-2
@@ -477,11 +485,15 @@ def theta_U2_from_RND(g, n_RND = int(1E6)):
477
485
 
478
486
  :param n_RND: number of random numbers [-] (default to int(1E6))
479
487
  :type n_RND: int
488
+
489
+ :param seed_RND: seed for the random number generator np.random.default_rng() [-] (default to None)
490
+ :type seed_RND: int
480
491
 
481
492
  :return: - **theta** (*np.ndarray*) – scattering angle [degrees]
482
493
  '''
483
494
 
484
- xi = np.random.rand(n_RND)
495
+ rng = np.random.default_rng(seed = seed_RND)
496
+ xi = rng.uniform(0., 1., size = n_RND)
485
497
 
486
498
  return np.arccos(((1 + g)**2 - 2*xi*(1 + g**2))/((1 + g)**2 - 4*g*xi))*180./np.pi
487
499
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: skinoptics
3
- Version: 0.0.1b7
3
+ Version: 0.0.1b9
4
4
  Summary: SkinOptics: a python package with tools for building human skin computational models for Monte Carlo simulations of light transport
5
5
  Author-email: Victor Lima <victorporto@ifsc.usp.br>
6
6
  Project-URL: Homepage, https://github.com/victorportog/skinoptics
@@ -1,6 +1,6 @@
1
- skinoptics/__init__.py,sha256=_UWhMASRUKozbt0nPNNydK6WBolnYI018yYYCNW4UKQ,1572
1
+ skinoptics/__init__.py,sha256=FMT5hVvpqS3l20etFpDHpYG2uRemCbGXuf8paFSlNo8,1572
2
2
  skinoptics/absorption_coefficient.py,sha256=f5mKTqgEiXKk0MDhPyL6t3w3jPDriJqI3R65U8mZNy8,36292
3
- skinoptics/anisotropy_factor.py,sha256=tMRDLT5DpAI4CEATo9qigjrfSuHVKOTPz-fLnJJ8IVA,37963
3
+ skinoptics/anisotropy_factor.py,sha256=_Yxma1DJYy5nezwrgi0hay-6NXpbU2RYTKa4zFrjF9E,38594
4
4
  skinoptics/colors.py,sha256=mUAQOyLiwM-PnLjDLNSz7Lt57iRBawXutsDxDwNMY4g,56759
5
5
  skinoptics/dataframes.py,sha256=EMN1Cr0gJu0TM5fZJTP5qk8Dfu5VqvhnxUq5mcS2zQQ,6485
6
6
  skinoptics/refractive_index.py,sha256=1zuSNIjy3KkbPH30YNbkPosASENTBtkxym8IML0Uy0A,14994
@@ -37,8 +37,8 @@ skinoptics/datasets/optical_properties/n_and_k_wat_Segelstein.txt,sha256=EZIS515
37
37
  skinoptics/datasets/optical_properties/oxy_and_deo_Bosschaart.txt,sha256=eF96Ao44TDUYRo6-8p0L7I9Q8h6wLNpEUyrcbo7FySA,24972
38
38
  skinoptics/datasets/spectra/Xiao2016/skindatabaseSpectra/readmeSpectra.docx,sha256=ren4htGe154BIlBridkvBvbc8AYY1RRmp4CVICYwDvc,15147
39
39
  skinoptics/datasets/spectra/Xiao2016/skindatabaseSpectra/skin spectra data.xlsx,sha256=z7shS1rZzqpaRGi_Ji0nYcSzIxEmADQOtaJ_Uwcotcc,1434709
40
- skinoptics-0.0.1b7.dist-info/licenses/LICENSE.txt,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
41
- skinoptics-0.0.1b7.dist-info/METADATA,sha256=JJqS041oF-pt4t6Tj4SUFLTIylvKdi8_evaBC80f0jM,1324
42
- skinoptics-0.0.1b7.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
43
- skinoptics-0.0.1b7.dist-info/top_level.txt,sha256=4NYJW3uliYlvbd-Zywg2MxJOGe4wYA7Oz_I5EZF4YEQ,11
44
- skinoptics-0.0.1b7.dist-info/RECORD,,
40
+ skinoptics-0.0.1b9.dist-info/licenses/LICENSE.txt,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
41
+ skinoptics-0.0.1b9.dist-info/METADATA,sha256=KXfHFH9O4ysY0BMOS2MsE7Yr74XAAa-wotxzHttZxD0,1324
42
+ skinoptics-0.0.1b9.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
43
+ skinoptics-0.0.1b9.dist-info/top_level.txt,sha256=4NYJW3uliYlvbd-Zywg2MxJOGe4wYA7Oz_I5EZF4YEQ,11
44
+ skinoptics-0.0.1b9.dist-info/RECORD,,