Conditions | 2 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
1 | #!/usr/bin/env python |
||
15 | def setUp(self): |
||
|
|||
16 | # Initialise some faux data and labels. |
||
17 | labels = "ABCDE" |
||
18 | N_labels = len(labels) |
||
19 | N_stars = np.random.randint(1, 500) |
||
20 | N_pixels = np.random.randint(1, 10000) |
||
21 | shape = (N_stars, N_pixels) |
||
22 | |||
23 | self.valid_training_labels = np.rec.array( |
||
24 | np.random.uniform(size=(N_stars, N_labels)), |
||
25 | dtype=[(label, '<f8') for label in labels]) |
||
26 | |||
27 | self.valid_fluxes = np.random.uniform(size=shape) |
||
28 | self.valid_flux_uncertainties = np.random.uniform(size=shape) |
||
29 | |||
52 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.