Skip to content

Commit

Permalink
final migration
Browse files Browse the repository at this point in the history
  • Loading branch information
jGaboardi committed Oct 24, 2023
1 parent 3e62357 commit e6cedb3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 31 deletions.
2 changes: 1 addition & 1 deletion giddy/ergodic.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def mfpt(P, fill_empty_classes=False):
ValueError: Input transition probability matrix has 1 rows full of 0s. \
Please set fill_empty_classes=True to set diagonal elements for these \
rows to be 1 to make sure the matrix is stochastic.
"""
"""

P = np.asarray(P)
rows0 = (P.sum(axis=1) == 0).sum()
Expand Down
16 changes: 8 additions & 8 deletions giddy/markov.py
Original file line number Diff line number Diff line change
Expand Up @@ -1910,30 +1910,30 @@ def summary(self, file_name=None, title="Markov Homogeneity Test"):
c = []
fmt = "r" * (k + 1)
s = "\\begin{tabular}{|%s|}\\hline\n" % fmt
s += "\\multicolumn{%s}{|c|}{%s}" % (ks, title) # noqa UP031
s += "\\multicolumn{%s}{|c|}{%s}" % (ks, title)
c.append(s)
s = "Number of classes: %d" % int(self.k)
c.append("\\hline\\multicolumn{%s}{|l|}{%s}" % (ks, s)) # noqa UP031
c.append("\\hline\\multicolumn{%s}{|l|}{%s}" % (ks, s))
s = "Number of transitions: %d" % int(self.t_total)
c.append("\\multicolumn{%s}{|l|}{%s}" % (ks, s)) # noqa UP031
c.append("\\multicolumn{%s}{|l|}{%s}" % (ks, s))
s = "Number of regimes: %d" % int(self.m)
c.append("\\multicolumn{%s}{|l|}{%s}" % (ks, s)) # noqa UP031
c.append("\\multicolumn{%s}{|l|}{%s}" % (ks, s))
s = "Regime names: "
s += ", ".join(regime_names)
c.append("\\multicolumn{%s}{|l|}{%s}" % (ks, s)) # noqa UP031
s = "\\hline\\multicolumn{2}{|l}{%s}" % ("Test") # noqa UP031
c.append("\\multicolumn{%s}{|l|}{%s}" % (ks, s))
s = "\\hline\\multicolumn{2}{|l}{%s}" % ("Test")
s += "&\\multicolumn{2}{r}{LR}&\\multicolumn{2}{r|}{Q}"
c.append(s)
s = "Stat."
s = "\\multicolumn{2}{|l}{%s}" % (s)
s += "&\\multicolumn{2}{r}{%.3f}" % self.LR
s += "&\\multicolumn{2}{r|}{%.3f}" % self.Q
c.append(s)
s = "\\multicolumn{2}{|l}{%s}" % ("DOF") # noqa UP031
s = "\\multicolumn{2}{|l}{%s}" % ("DOF")
s += "&\\multicolumn{2}{r}{%d}" % int(self.dof)
s += "&\\multicolumn{2}{r|}{%d}" % int(self.dof)
c.append(s)
s = "\\multicolumn{2}{|l}{%s}" % ("p-value") # noqa UP031
s = "\\multicolumn{2}{|l}{%s}" % ("p-value")
s += "&\\multicolumn{2}{r}{%.3f}" % self.LR_p_value
s += "&\\multicolumn{2}{r|}{%.3f}" % self.Q_p_value
c.append(s)
Expand Down
34 changes: 12 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,39 +79,29 @@ select = ["E", "F", "W", "I", "UP", "N", "B", "A", "C4", "SIM", "ARG"]
target-version = "py39"
exclude = ["giddy/tests/*", "docs/*"]
[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"] # imported but unused
"giddy/directional.py" = [
"ARG002", # Unused method argument
"N803", # Argument name should be lowercase
"N806", # Variable in function should be lowercase
"__init__.py" = [
"F401" # imported but unused
]
"giddy/ergodic.py" = [
"N803", # Argument name should be lowercase
"N806", # Variable in function should be lowercase
"giddy/{directional,ergodic,markov,rank,sequence,util}.py" = [
"ARG002", # Unused method argument
"N801", # Class name should use CapWords convention
"N802", # Function name should be lowercase
"N803", # Argument name should be lowercase
"N806", # Variable in function should be lowercase
]
"giddy/markov.py" = [
"B006", # Do not use mutable data structures for argument defaults
"N801", # Class name should use CapWords convention
"N802", # Function name should be lowercase
"N803",
"N806",
"B006", # Do not use mutable data structures for argument defaults
"UP031", # Use format specifiers instead of percent format
]
"giddy/rank.py" = [
"ARG002",
"N801",
"N803",
"N806",
"giddy/{ergodic,markov,sequence}.py" = [
"E501", # Line too long
]
"giddy/sequence.py" = ["N806"]
"giddy/util.py" = ["N803"]

[tool.coverage.run]
source = ["./giddy"]

[tool.coverage.report]
exclude_lines = [
"if self.debug:",
"pragma: no cover",
"raise NotImplementedError",
"except ModuleNotFoundError:",
"except ImportError",
Expand Down

0 comments on commit e6cedb3

Please sign in to comment.