|
1 | 1 | import numpy |
2 | | - |
| 2 | +import warnings |
3 | 3 | from amuse.ext.evrard_test import body_centered_grid_unit_cube |
4 | 4 | from amuse.ext.evrard_test import regular_grid_unit_cube |
5 | 5 | from amuse.ext.evrard_test import uniform_random_unit_cube |
@@ -44,17 +44,46 @@ def make_xyz(self): |
44 | 44 | return self.cutout_cylinder(*(self.base_grid(self.estimatedN)).make_xyz()) |
45 | 45 |
|
46 | 46 |
|
47 | | -class ProtoPlanetaryDisk(object): |
| 47 | +class ProtoPlanetaryDisk: |
| 48 | + |
| 49 | + def __init__( |
| 50 | + self, targetN, convert_nbody=None, discfraction=0.1, |
| 51 | + densitypower=1., thermalpower=0.5, radius_min=1, radius_max=100, |
| 52 | + gamma=1.,q_out=2.,base_grid=None, Rmin=None, Rmax=None, |
| 53 | + ): |
| 54 | + if Rmin is not None: |
| 55 | + warnings.warn( |
| 56 | + "Rmin is deprecated, use radius_min instead", |
| 57 | + category=FutureWarning, |
| 58 | + ) |
| 59 | + if radius_min is not None and radius_min != Rmin: |
| 60 | + raise ValueError( |
| 61 | + "Rmin and radius_min have different values, " |
| 62 | + "this is only allowed if one of them is None" |
| 63 | + ) |
| 64 | + radius_min = Rmin |
| 65 | + if radius_min is None: |
| 66 | + raise ValueError("radius_min must be set") |
| 67 | + if Rmax is not None: |
| 68 | + warnings.warn( |
| 69 | + "Rmax is deprecated, use radius_max instead", |
| 70 | + category=FutureWarning, |
| 71 | + ) |
| 72 | + if radius_max is not None and radius_max != Rmax: |
| 73 | + raise ValueError( |
| 74 | + "Rmax and radius_max have different values, " |
| 75 | + "this is only allowed if one of them is None" |
| 76 | + ) |
| 77 | + radius_max = Rmax |
| 78 | + if radius_max is None: |
| 79 | + raise ValueError("radius_max must be set") |
48 | 80 |
|
49 | | - def __init__(self, targetN, convert_nbody = None, discfraction=0.1, |
50 | | - densitypower=1., thermalpower=0.5, Rmin=1,Rmax=100, |
51 | | - gamma=1.,q_out=2.,base_grid=None): |
52 | 81 | self.targetN=targetN |
53 | 82 | self.convert_nbody=convert_nbody |
54 | 83 | self.densitypower=densitypower |
55 | 84 | self.thermalpower=thermalpower |
56 | | - self.Rmin=Rmin |
57 | | - self.Rmax=Rmax |
| 85 | + self.Rmin=radius_min |
| 86 | + self.Rmax=radius_max |
58 | 87 | self.gamma=gamma |
59 | 88 | self.q_out=q_out |
60 | 89 | self.discfraction=discfraction |
|
0 commit comments