Giter Club home page Giter Club logo

statista's People

Contributors

actions-user avatar dependabot[bot] avatar mafarrag avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

statista's Issues

ModuleNotFoundError: No module named 'statista'

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
after installing the package, not able to import it

Screenshots
___________________ ERROR collecting tests/test_plot_map.py ____________________ ImportError while importing test module '/home/runner/work/cleopatra/cleopatra/tests/test_plot_map.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: /usr/share/miniconda3/lib/python3.9/importlib/__init__.py:1[27](https://github.com/MAfarrag/cleopatra/runs/6661943937?check_suite_focus=true#step:6:28): in import_module return _bootstrap._gcd_import(name[level:], package, level) tests/test_plot_map.py:9: in <module> from cleopatra.map import Map cleopatra/__init__.py:33: in <module> import cleopatra.map cleopatra/map.py:20: in <module> from statista.tools import Tools as ST E ModuleNotFoundError: No module named 'statista'

Additional context
Add any other context about the problem here.

Unify the probability_plot parameters

the probability_plot function differs from the GEV and the Gumbel distributions (especially in the method, n_samples, and func parameters) and needs to be unified

[statista] statista/distributions.py (Lines 1382-1395)


def probability_plot(
        self,
        parameters: Dict[str, Union[float, Any]],
        cdf: Union[np.ndarray, list],
        alpha: Number = 0.1,
        func: Callable = None,
        method: str = "lmoments",
        n_samples=100,
        fig1_size=(10, 5),
        fig2_size=(6, 6),
        xlabel="Actual data",
        ylabel="cdf",
        fontsize=15,
    ):

Open in IDE · Open on GitHub

Created from JetBrains using CodeStream

pdf repeated part

This plotting part is repeated in all distribution but is not yet passed upstream to the abstract class method because of the

[statista] statista/distributions.py (Lines 977-994)


if plot_figure:
            Qx = np.linspace(
                float(self.data_sorted[0]), 1.5 * float(self.data_sorted[-1]), 10000
            )
            pdf_fitted = self.pdf(parameters, actualdata=Qx)

            fig, ax = Plot.pdf(
                Qx,
                pdf_fitted,
                self.data_sorted,
                figsize=figsize,
                xlabel=xlabel,
                ylabel=ylabel,
                fontsize=fontsize,
            )
            return pdf, fig, ax
        else:
            return pdf

Open in IDE · Open on GitHub

Created from JetBrains using CodeStream

change the function api to take the distribution parameters as a dictionary

replace the individual keyword arguments to one single dictionary positional argument.
parameters = {"loc", val, "scale": val}

[statista] statista/distributions.py (Lines 626-639)


def get_rp(self, loc, scale, data):
        """getRP.

            getRP calculates the return period for a list/array of values or a single value.

        Parameters
        ----------
        data:[list/array/float]
            value you want the coresponding return value for
        loc: [float]
            location parameter
        scale: [float]
            scale parameter

Open in IDE · Open on GitHub

Created from JetBrains using CodeStream

cicd-pull request naming convention github action

create github action to check and enforce naming of pull requests
create a github action to check the name of a pull request and make sure it follows a certain pattern

the naming convention should follow
<module-name>/<class-name>/<method-name>/<task-tybe>

task-type: feature|bugfix|hotfix|release|docs

workflow Link

Unify the probability_plot parameters

the probability_plot function differs from the GEV and the Gumbel distributions (especially in the method, n_samples, and func parameters) and needs to be unified

[statista] statista/distributions.py (Lines 1382-1395)


def probability_plot(
        self,
        parameters: Dict[str, Union[float, Any]],
        cdf: Union[np.ndarray, list],
        alpha: Number = 0.1,
        func: Callable = None,
        method: str = "lmoments",
        n_samples=100,
        fig1_size=(10, 5),
        fig2_size=(6, 6),
        xlabel="Actual data",
        ylabel="cdf",
        fontsize=15,
    ):

Open in IDE · Open on GitHub

Created from JetBrains using CodeStream

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.