Issues (587)

mutis/flares/flare.py (37 issues)

1
""" Flare analysis """
2
3
import logging
4
5
import numpy as np
0 ignored issues
show
Unable to import 'numpy'
Loading history...
Unused numpy imported as np
Loading history...
6
import scipy as sp
0 ignored issues
show
Unused scipy imported as sp
Loading history...
Unable to import 'scipy'
Loading history...
7
import pandas as pd
0 ignored issues
show
Unused pandas imported as pd
Loading history...
Unable to import 'pandas'
Loading history...
8
9
import matplotlib as mplt
0 ignored issues
show
Unable to import 'matplotlib'
Loading history...
Unused matplotlib imported as mplt
Loading history...
10
import matplotlib.pyplot as plt
0 ignored issues
show
Unable to import 'matplotlib.pyplot'
Loading history...
11
12
import sys
0 ignored issues
show
The import sys seems to be unused.
Loading history...
standard import "import sys" should be placed before "import numpy as np"
Loading history...
13
import os
0 ignored issues
show
standard import "import os" should be placed before "import numpy as np"
Loading history...
The import os seems to be unused.
Loading history...
14
import glob
0 ignored issues
show
The import glob seems to be unused.
Loading history...
standard import "import glob" should be placed before "import numpy as np"
Loading history...
15
16
import re
0 ignored issues
show
The import re seems to be unused.
Loading history...
standard import "import re" should be placed before "import numpy as np"
Loading history...
17
from datetime import datetime
0 ignored issues
show
Unused datetime imported from datetime
Loading history...
standard import "from datetime import datetime" should be placed before "import numpy as np"
Loading history...
18
19
from astropy.stats import bayesian_blocks
0 ignored issues
show
Unused bayesian_blocks imported from astropy.stats
Loading history...
Unable to import 'astropy.stats'
Loading history...
20
21
import warnings 
0 ignored issues
show
standard import "import warnings" should be placed before "import numpy as np"
Loading history...
The import warnings seems to be unused.
Loading history...
Trailing whitespace
Loading history...
22
23
from mutis import Signal
0 ignored issues
show
Unused Signal imported from mutis
Loading history...
24
#from mutis.flares.bayblocks import BayesianBlocks
25
import mutis.flares.bayblocks as bayblocks
0 ignored issues
show
Unused mutis.flares.bayblocks imported as bayblocks
Loading history...
26
27
log = logging.getLogger(__name__)
28
29
30
    
0 ignored issues
show
Trailing whitespace
Loading history...
31
class Flare:
32
    """Container class for a Flare object
33
    
0 ignored issues
show
Trailing whitespace
Loading history...
34
    Attributes
35
    ----------
36
    tstart: float
37
            time at which the flare starts
38
    tstop: float
39
            time at which the flare ends
40
    """
41
    
0 ignored issues
show
Trailing whitespace
Loading history...
42
    def __init__(self, tstart, tstop):
43
        self.tstart = tstart
44
        self.tstop = tstop
45
    
0 ignored issues
show
Trailing whitespace
Loading history...
46
    def __repr__(self):
47
        return f"Flare({self.tstart},{self.tstop})"
48
    
0 ignored issues
show
Trailing whitespace
Loading history...
49
    def __str__(self):
50
        return self.__repr__()
51
        
0 ignored issues
show
Trailing whitespace
Loading history...
52
    
0 ignored issues
show
Trailing whitespace
Loading history...
53
    def plot(self, ax=None, **kwargs):
0 ignored issues
show
Coding Style Naming introduced by
Argument name "ax" doesn't conform to snake_case naming style ('([^\\W\\dA-Z][^\\WA-Z]2,|_[^\\WA-Z]*|__[^\\WA-Z\\d_][^\\WA-Z]+__)$' pattern)

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
54
        """Plots the flare as a colored area """
55
        ax = plt.gca() if ax is None else ax
56
        
0 ignored issues
show
Trailing whitespace
Loading history...
57
        ax.axvspan(self.tstart, self.tstop, facecolor='r', edgecolor=None, alpha=0.2, **kwargs)
58
        
0 ignored issues
show
Trailing whitespace
Loading history...
59
        pass
0 ignored issues
show
Unnecessary pass statement
Loading history...
60