pysips 0.0.0__tar.gz → 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. pysips-0.1.0/.github/workflows/pylint.yml +24 -0
  2. pysips-0.1.0/.github/workflows/pypi.yml +149 -0
  3. pysips-0.1.0/.github/workflows/pytest.yml +24 -0
  4. pysips-0.1.0/.gitignore +8 -0
  5. pysips-0.1.0/.pylintrc +650 -0
  6. {pysips-0.0.0/pysips.egg-info → pysips-0.1.0}/PKG-INFO +1 -3
  7. {pysips-0.0.0 → pysips-0.1.0}/README.md +0 -2
  8. pysips-0.1.0/demos/basic_usage.ipynb +188 -0
  9. {pysips-0.0.0 → pysips-0.1.0}/pyproject.toml +7 -0
  10. {pysips-0.0.0 → pysips-0.1.0/pysips.egg-info}/PKG-INFO +1 -3
  11. {pysips-0.0.0 → pysips-0.1.0}/pysips.egg-info/SOURCES.txt +6 -0
  12. {pysips-0.0.0 → pysips-0.1.0}/LICENSE +0 -0
  13. {pysips-0.0.0 → pysips-0.1.0}/pysips/__init__.py +0 -0
  14. {pysips-0.0.0 → pysips-0.1.0}/pysips/crossover_proposal.py +0 -0
  15. {pysips-0.0.0 → pysips-0.1.0}/pysips/laplace_nmll.py +0 -0
  16. {pysips-0.0.0 → pysips-0.1.0}/pysips/metropolis.py +0 -0
  17. {pysips-0.0.0 → pysips-0.1.0}/pysips/mutation_proposal.py +0 -0
  18. {pysips-0.0.0 → pysips-0.1.0}/pysips/prior.py +0 -0
  19. {pysips-0.0.0 → pysips-0.1.0}/pysips/random_choice_proposal.py +0 -0
  20. {pysips-0.0.0 → pysips-0.1.0}/pysips/regressor.py +0 -0
  21. {pysips-0.0.0 → pysips-0.1.0}/pysips/sampler.py +0 -0
  22. {pysips-0.0.0 → pysips-0.1.0}/pysips.egg-info/dependency_links.txt +0 -0
  23. {pysips-0.0.0 → pysips-0.1.0}/pysips.egg-info/requires.txt +0 -0
  24. {pysips-0.0.0 → pysips-0.1.0}/pysips.egg-info/top_level.txt +0 -0
  25. {pysips-0.0.0 → pysips-0.1.0}/setup.cfg +0 -0
  26. {pysips-0.0.0 → pysips-0.1.0}/tests/integration/test_log_likelihood.py +0 -0
  27. {pysips-0.0.0 → pysips-0.1.0}/tests/integration/test_prior_with_bingo.py +0 -0
  28. {pysips-0.0.0 → pysips-0.1.0}/tests/regression/test_basic_end_to_end.py +0 -0
  29. {pysips-0.0.0 → pysips-0.1.0}/tests/regression/test_regressor_end_to_end.py +0 -0
  30. {pysips-0.0.0 → pysips-0.1.0}/tests/unit/test_crossover_proposal.py +0 -0
  31. {pysips-0.0.0 → pysips-0.1.0}/tests/unit/test_laplace_nmll.py +0 -0
  32. {pysips-0.0.0 → pysips-0.1.0}/tests/unit/test_metropolis.py +0 -0
  33. {pysips-0.0.0 → pysips-0.1.0}/tests/unit/test_mutation_proposal.py +0 -0
  34. {pysips-0.0.0 → pysips-0.1.0}/tests/unit/test_prior.py +0 -0
  35. {pysips-0.0.0 → pysips-0.1.0}/tests/unit/test_random_choice_proposal.py +0 -0
  36. {pysips-0.0.0 → pysips-0.1.0}/tests/unit/test_regressor.py +0 -0
  37. {pysips-0.0.0 → pysips-0.1.0}/tests/unit/test_sampler.py +0 -0
@@ -0,0 +1,24 @@
1
+ name: Pylint
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ linting:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ python-version: ["3.12", "3.13"]
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - name: Set up Python ${{ matrix.python-version }}
14
+ uses: actions/setup-python@v5
15
+ with:
16
+ python-version: ${{ matrix.python-version }}
17
+ - name: Install dependencies
18
+ run: |
19
+ python -m pip install --upgrade pip
20
+ pip install pylint
21
+ pip install -e .
22
+ - name: Analysing the code with pylint
23
+ run: |
24
+ pylint pysips --fail-under=10
@@ -0,0 +1,149 @@
1
+ # roughly following https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
2
+
3
+ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
4
+
5
+ on: [push]
6
+
7
+ jobs:
8
+ pip_build_test:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - name: Checkout repository and submodules
12
+ uses: actions/checkout@v4
13
+ with:
14
+ submodules: recursive
15
+ - name: Set up Python 3.x
16
+ uses: actions/setup-python@v5
17
+ with:
18
+ python-version: "3.x"
19
+ - name: Build using pip
20
+ run: |
21
+ python -m pip install --upgrade pip
22
+ pip install pytest pytest-mock
23
+ pip install -e .
24
+ - name: Testing the code with pytest
25
+ run: |
26
+ pytest tests/
27
+
28
+
29
+ build:
30
+ needs: pip_build_test
31
+ name: Build source distribution 📦
32
+ runs-on: ubuntu-latest
33
+ steps:
34
+ - name: Checkout repository and submodules
35
+ uses: actions/checkout@v4
36
+ with:
37
+ fetch-depth: 0
38
+ - name: Set up Python 3.x
39
+ uses: actions/setup-python@v5
40
+ with:
41
+ python-version: "3.x"
42
+ - name: Install dependencies
43
+ run: |
44
+ python -m pip install --upgrade pip
45
+ pip install build
46
+ - name: Build PyPI package
47
+ run: |
48
+ python -m build
49
+ - name: see whats in the dist
50
+ run: ls dist
51
+ - name: Upload dist
52
+ uses: actions/upload-artifact@v4
53
+ with:
54
+ name: python-package-dist
55
+ path: dist/*
56
+
57
+ publish-to-pypi:
58
+ name: >-
59
+ Publish Python 🐍 distribution 📦 to PyPI
60
+ if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
61
+ needs:
62
+ - build
63
+ runs-on: ubuntu-latest
64
+ environment:
65
+ name: pypi
66
+ url: https://pypi.org/p/pysips
67
+ permissions:
68
+ id-token: write # IMPORTANT: mandatory for trusted publishing
69
+
70
+ steps:
71
+ - name: Download the dist
72
+ uses: actions/download-artifact@v4
73
+ with:
74
+ name: python-package-dist
75
+ path: dist/
76
+
77
+ - name: Publish distribution 📦 to PyPI
78
+ uses: pypa/gh-action-pypi-publish@release/v1
79
+
80
+
81
+ github-release:
82
+ name: >-
83
+ Sign the Python 🐍 distribution 📦 with Sigstore
84
+ and upload them to GitHub Release
85
+ needs:
86
+ - publish-to-pypi
87
+ runs-on: ubuntu-latest
88
+
89
+ permissions:
90
+ contents: write # IMPORTANT: mandatory for making GitHub Releases
91
+ id-token: write # IMPORTANT: mandatory for sigstore
92
+
93
+ steps:
94
+ - name: Download the dist
95
+ uses: actions/download-artifact@v4
96
+ with:
97
+ name: python-package-dist
98
+ path: dist/
99
+ - name: Sign the dists with Sigstore
100
+ uses: sigstore/gh-action-sigstore-python@v3.0.0
101
+ with:
102
+ inputs: >-
103
+ ./dist/*.tar.gz
104
+ ./dist/*.whl
105
+ - name: Create GitHub Release
106
+ env:
107
+ GITHUB_TOKEN: ${{ github.token }}
108
+ run: >-
109
+ gh release create
110
+ '${{ github.ref_name }}'
111
+ --repo '${{ github.repository }}'
112
+ --notes ""
113
+ - name: Upload artifact signatures to GitHub Release
114
+ env:
115
+ GITHUB_TOKEN: ${{ github.token }}
116
+ # Upload to GitHub Release using the `gh` CLI.
117
+ # `dist/` contains the built packages, and the
118
+ # sigstore-produced signatures and certificates.
119
+ run: >-
120
+ gh release upload
121
+ '${{ github.ref_name }}' dist/**
122
+ --repo '${{ github.repository }}'
123
+
124
+
125
+ publish-to-testpypi:
126
+ name: Publish Python 🐍 distribution 📦 to TestPyPI
127
+ if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' # publish to testPyPI on main and develop branches
128
+ needs:
129
+ - build
130
+ runs-on: ubuntu-latest
131
+
132
+ environment:
133
+ name: testpypi
134
+ url: https://test.pypi.org/p/pysips
135
+
136
+ permissions:
137
+ id-token: write # IMPORTANT: mandatory for trusted publishing
138
+
139
+ steps:
140
+ - name: Download dist
141
+ uses: actions/download-artifact@v4
142
+ with:
143
+ name: python-package-dist
144
+ path: dist/
145
+ - name: Publish distribution 📦 to TestPyPI
146
+ uses: pypa/gh-action-pypi-publish@release/v1
147
+ with:
148
+ repository-url: https://test.pypi.org/legacy/
149
+ verbose: true
@@ -0,0 +1,24 @@
1
+ name: Pytest
2
+
3
+ on: [push]
4
+
5
+ jobs:
6
+ testing:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ matrix:
10
+ python-version: ["3.13"]
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - name: Set up Python ${{ matrix.python-version }}
14
+ uses: actions/setup-python@v5
15
+ with:
16
+ python-version: ${{ matrix.python-version }}
17
+ - name: Build using pip
18
+ run: |
19
+ python -m pip install --upgrade pip
20
+ pip install pytest pytest-mock
21
+ pip install -e .
22
+ - name: Testing the code with pytest
23
+ run: |
24
+ pytest tests/
@@ -0,0 +1,8 @@
1
+ *.pyc
2
+ *.cache/*
3
+ *.cache/
4
+ *.ipynb_checkpoints/
5
+ .pytest_cache/
6
+ .pypirc
7
+ dist/*
8
+ *.egg-info/
pysips-0.1.0/.pylintrc ADDED
@@ -0,0 +1,650 @@
1
+ [MAIN]
2
+
3
+ # Analyse import fallback blocks. This can be used to support both Python 2 and
4
+ # 3 compatible code, which means that the block might have code that exists
5
+ # only in one or another interpreter, leading to false positives when analysed.
6
+ analyse-fallback-blocks=no
7
+
8
+ # Clear in-memory caches upon conclusion of linting. Useful if running pylint
9
+ # in a server-like mode.
10
+ clear-cache-post-run=no
11
+
12
+ # Load and enable all available extensions. Use --list-extensions to see a list
13
+ # all available extensions.
14
+ #enable-all-extensions=
15
+
16
+ # In error mode, messages with a category besides ERROR or FATAL are
17
+ # suppressed, and no reports are done by default. Error mode is compatible with
18
+ # disabling specific errors.
19
+ #errors-only=
20
+
21
+ # Always return a 0 (non-error) status code, even if lint errors are found.
22
+ # This is primarily useful in continuous integration scripts.
23
+ #exit-zero=
24
+
25
+ # A comma-separated list of package or module names from where C extensions may
26
+ # be loaded. Extensions are loading into the active Python interpreter and may
27
+ # run arbitrary code.
28
+ extension-pkg-allow-list=
29
+
30
+ # A comma-separated list of package or module names from where C extensions may
31
+ # be loaded. Extensions are loading into the active Python interpreter and may
32
+ # run arbitrary code. (This is an alternative name to extension-pkg-allow-list
33
+ # for backward compatibility.)
34
+ extension-pkg-whitelist=
35
+
36
+ # Return non-zero exit code if any of these messages/categories are detected,
37
+ # even if score is above --fail-under value. Syntax same as enable. Messages
38
+ # specified are enabled, while categories only check already-enabled messages.
39
+ fail-on=
40
+
41
+ # Specify a score threshold under which the program will exit with error.
42
+ fail-under=10
43
+
44
+ # Interpret the stdin as a python script, whose filename needs to be passed as
45
+ # the module_or_package argument.
46
+ #from-stdin=
47
+
48
+ # Files or directories to be skipped. They should be base names, not paths.
49
+ ignore=CVS
50
+
51
+ # Add files or directories matching the regular expressions patterns to the
52
+ # ignore-list. The regex matches against paths and can be in Posix or Windows
53
+ # format. Because '\\' represents the directory delimiter on Windows systems,
54
+ # it can't be used as an escape character.
55
+ ignore-paths=
56
+
57
+ # Files or directories matching the regular expression patterns are skipped.
58
+ # The regex matches against base names, not paths. The default value ignores
59
+ # Emacs file locks
60
+ ignore-patterns=^\.#
61
+
62
+ # List of module names for which member attributes should not be checked and
63
+ # will not be imported (useful for modules/projects where namespaces are
64
+ # manipulated during runtime and thus existing member attributes cannot be
65
+ # deduced by static analysis). It supports qualified module names, as well as
66
+ # Unix pattern matching.
67
+ ignored-modules=
68
+
69
+ # Python code to execute, usually for sys.path manipulation such as
70
+ # pygtk.require().
71
+ #init-hook=
72
+
73
+ # Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
74
+ # number of processors available to use, and will cap the count on Windows to
75
+ # avoid hangs.
76
+ jobs=1
77
+
78
+ # Control the amount of potential inferred values when inferring a single
79
+ # object. This can help the performance when dealing with large functions or
80
+ # complex, nested conditions.
81
+ limit-inference-results=100
82
+
83
+ # List of plugins (as comma separated values of python module names) to load,
84
+ # usually to register additional checkers.
85
+ load-plugins=
86
+
87
+ # Pickle collected data for later comparisons.
88
+ persistent=yes
89
+
90
+ # Resolve imports to .pyi stubs if available. May reduce no-member messages and
91
+ # increase not-an-iterable messages.
92
+ prefer-stubs=no
93
+
94
+ # Minimum Python version to use for version dependent checks. Will default to
95
+ # the version used to run pylint.
96
+ py-version=3.13
97
+
98
+ # Discover python modules and packages in the file system subtree.
99
+ recursive=no
100
+
101
+ # Add paths to the list of the source roots. Supports globbing patterns. The
102
+ # source root is an absolute path or a path relative to the current working
103
+ # directory used to determine a package namespace for modules located under the
104
+ # source root.
105
+ source-roots=
106
+
107
+ # When enabled, pylint would attempt to guess common misconfiguration and emit
108
+ # user-friendly hints instead of false-positive error messages.
109
+ suggestion-mode=yes
110
+
111
+ # Allow loading of arbitrary C extensions. Extensions are imported into the
112
+ # active Python interpreter and may run arbitrary code.
113
+ unsafe-load-any-extension=no
114
+
115
+ # In verbose mode, extra non-checker-related info will be displayed.
116
+ #verbose=
117
+
118
+
119
+ [BASIC]
120
+
121
+ # Naming style matching correct argument names.
122
+ argument-naming-style=snake_case
123
+
124
+ # Regular expression matching correct argument names. Overrides argument-
125
+ # naming-style. If left empty, argument names will be checked with the set
126
+ # naming style.
127
+ #argument-rgx=
128
+
129
+ # Naming style matching correct attribute names.
130
+ attr-naming-style=snake_case
131
+
132
+ # Regular expression matching correct attribute names. Overrides attr-naming-
133
+ # style. If left empty, attribute names will be checked with the set naming
134
+ # style.
135
+ #attr-rgx=
136
+
137
+ # Bad variable names which should always be refused, separated by a comma.
138
+ bad-names=foo,
139
+ bar,
140
+ baz,
141
+ toto,
142
+ tutu,
143
+ tata
144
+
145
+ # Bad variable names regexes, separated by a comma. If names match any regex,
146
+ # they will always be refused
147
+ bad-names-rgxs=
148
+
149
+ # Naming style matching correct class attribute names.
150
+ class-attribute-naming-style=any
151
+
152
+ # Regular expression matching correct class attribute names. Overrides class-
153
+ # attribute-naming-style. If left empty, class attribute names will be checked
154
+ # with the set naming style.
155
+ #class-attribute-rgx=
156
+
157
+ # Naming style matching correct class constant names.
158
+ class-const-naming-style=UPPER_CASE
159
+
160
+ # Regular expression matching correct class constant names. Overrides class-
161
+ # const-naming-style. If left empty, class constant names will be checked with
162
+ # the set naming style.
163
+ #class-const-rgx=
164
+
165
+ # Naming style matching correct class names.
166
+ class-naming-style=PascalCase
167
+
168
+ # Regular expression matching correct class names. Overrides class-naming-
169
+ # style. If left empty, class names will be checked with the set naming style.
170
+ #class-rgx=
171
+
172
+ # Naming style matching correct constant names.
173
+ const-naming-style=UPPER_CASE
174
+
175
+ # Regular expression matching correct constant names. Overrides const-naming-
176
+ # style. If left empty, constant names will be checked with the set naming
177
+ # style.
178
+ #const-rgx=
179
+
180
+ # Minimum line length for functions/classes that require docstrings, shorter
181
+ # ones are exempt.
182
+ docstring-min-length=-1
183
+
184
+ # Naming style matching correct function names.
185
+ function-naming-style=snake_case
186
+
187
+ # Regular expression matching correct function names. Overrides function-
188
+ # naming-style. If left empty, function names will be checked with the set
189
+ # naming style.
190
+ #function-rgx=
191
+
192
+ # Good variable names which should always be accepted, separated by a comma.
193
+ good-names=i,
194
+ j,
195
+ k,
196
+ X,
197
+ y,
198
+ N,
199
+ ex,
200
+ Run,
201
+ _
202
+
203
+ # Good variable names regexes, separated by a comma. If names match any regex,
204
+ # they will always be accepted
205
+ good-names-rgxs=
206
+
207
+ # Include a hint for the correct naming format with invalid-name.
208
+ include-naming-hint=no
209
+
210
+ # Naming style matching correct inline iteration names.
211
+ inlinevar-naming-style=any
212
+
213
+ # Regular expression matching correct inline iteration names. Overrides
214
+ # inlinevar-naming-style. If left empty, inline iteration names will be checked
215
+ # with the set naming style.
216
+ #inlinevar-rgx=
217
+
218
+ # Naming style matching correct method names.
219
+ method-naming-style=snake_case
220
+
221
+ # Regular expression matching correct method names. Overrides method-naming-
222
+ # style. If left empty, method names will be checked with the set naming style.
223
+ #method-rgx=
224
+
225
+ # Naming style matching correct module names.
226
+ module-naming-style=snake_case
227
+
228
+ # Regular expression matching correct module names. Overrides module-naming-
229
+ # style. If left empty, module names will be checked with the set naming style.
230
+ #module-rgx=
231
+
232
+ # Colon-delimited sets of names that determine each other's naming style when
233
+ # the name regexes allow several styles.
234
+ name-group=
235
+
236
+ # Regular expression which should only match function or class names that do
237
+ # not require a docstring.
238
+ no-docstring-rgx=^_
239
+
240
+ # List of decorators that produce properties, such as abc.abstractproperty. Add
241
+ # to this list to register other decorators that produce valid properties.
242
+ # These decorators are taken in consideration only for invalid-name.
243
+ property-classes=abc.abstractproperty
244
+
245
+ # Regular expression matching correct type alias names. If left empty, type
246
+ # alias names will be checked with the set naming style.
247
+ #typealias-rgx=
248
+
249
+ # Regular expression matching correct type variable names. If left empty, type
250
+ # variable names will be checked with the set naming style.
251
+ #typevar-rgx=
252
+
253
+ # Naming style matching correct variable names.
254
+ variable-naming-style=snake_case
255
+
256
+ # Regular expression matching correct variable names. Overrides variable-
257
+ # naming-style. If left empty, variable names will be checked with the set
258
+ # naming style.
259
+ #variable-rgx=
260
+
261
+
262
+ [CLASSES]
263
+
264
+ # Warn about protected attribute access inside special methods
265
+ check-protected-access-in-special-methods=no
266
+
267
+ # List of method names used to declare (i.e. assign) instance attributes.
268
+ defining-attr-methods=__init__,
269
+ __new__,
270
+ setUp,
271
+ asyncSetUp,
272
+ __post_init__
273
+
274
+ # List of member names, which should be excluded from the protected access
275
+ # warning.
276
+ exclude-protected=_asdict,_fields,_replace,_source,_make,os._exit
277
+
278
+ # List of valid names for the first argument in a class method.
279
+ valid-classmethod-first-arg=cls
280
+
281
+ # List of valid names for the first argument in a metaclass class method.
282
+ valid-metaclass-classmethod-first-arg=mcs
283
+
284
+
285
+ [DESIGN]
286
+
287
+ # List of regular expressions of class ancestor names to ignore when counting
288
+ # public methods (see R0903)
289
+ exclude-too-few-public-methods=
290
+
291
+ # List of qualified class names to ignore when counting class parents (see
292
+ # R0901)
293
+ ignored-parents=
294
+
295
+ # Maximum number of arguments for function / method.
296
+ max-args=5
297
+
298
+ # Maximum number of attributes for a class (see R0902).
299
+ max-attributes=7
300
+
301
+ # Maximum number of boolean expressions in an if statement (see R0916).
302
+ max-bool-expr=5
303
+
304
+ # Maximum number of branch for function / method body.
305
+ max-branches=12
306
+
307
+ # Maximum number of locals for function / method body.
308
+ max-locals=15
309
+
310
+ # Maximum number of parents for a class (see R0901).
311
+ max-parents=7
312
+
313
+ # Maximum number of positional arguments for function / method.
314
+ max-positional-arguments=5
315
+
316
+ # Maximum number of public methods for a class (see R0904).
317
+ max-public-methods=20
318
+
319
+ # Maximum number of return / yield for function / method body.
320
+ max-returns=6
321
+
322
+ # Maximum number of statements in function / method body.
323
+ max-statements=50
324
+
325
+ # Minimum number of public methods for a class (see R0903).
326
+ min-public-methods=2
327
+
328
+
329
+ [EXCEPTIONS]
330
+
331
+ # Exceptions that will emit a warning when caught.
332
+ overgeneral-exceptions=builtins.BaseException,builtins.Exception
333
+
334
+
335
+ [FORMAT]
336
+
337
+ # Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
338
+ expected-line-ending-format=
339
+
340
+ # Regexp for a line that is allowed to be longer than the limit.
341
+ ignore-long-lines=^\s*(# )?<?https?://\S+>?$
342
+
343
+ # Number of spaces of indent required inside a hanging or continued line.
344
+ indent-after-paren=4
345
+
346
+ # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
347
+ # tab).
348
+ indent-string=' '
349
+
350
+ # Maximum number of characters on a single line.
351
+ max-line-length=100
352
+
353
+ # Maximum number of lines in a module.
354
+ max-module-lines=1000
355
+
356
+ # Allow the body of a class to be on the same line as the declaration if body
357
+ # contains single statement.
358
+ single-line-class-stmt=no
359
+
360
+ # Allow the body of an if to be on the same line as the test if there is no
361
+ # else.
362
+ single-line-if-stmt=no
363
+
364
+
365
+ [IMPORTS]
366
+
367
+ # List of modules that can be imported at any level, not just the top level
368
+ # one.
369
+ allow-any-import-level=
370
+
371
+ # Allow explicit reexports by alias from a package __init__.
372
+ allow-reexport-from-package=no
373
+
374
+ # Allow wildcard imports from modules that define __all__.
375
+ allow-wildcard-with-all=no
376
+
377
+ # Deprecated modules which should not be used, separated by a comma.
378
+ deprecated-modules=
379
+
380
+ # Output a graph (.gv or any supported image format) of external dependencies
381
+ # to the given file (report RP0402 must not be disabled).
382
+ ext-import-graph=
383
+
384
+ # Output a graph (.gv or any supported image format) of all (i.e. internal and
385
+ # external) dependencies to the given file (report RP0402 must not be
386
+ # disabled).
387
+ import-graph=
388
+
389
+ # Output a graph (.gv or any supported image format) of internal dependencies
390
+ # to the given file (report RP0402 must not be disabled).
391
+ int-import-graph=
392
+
393
+ # Force import order to recognize a module as part of the standard
394
+ # compatibility libraries.
395
+ known-standard-library=
396
+
397
+ # Force import order to recognize a module as part of a third party library.
398
+ known-third-party=enchant
399
+
400
+ # Couples of modules and preferred modules, separated by a comma.
401
+ preferred-modules=
402
+
403
+
404
+ [LOGGING]
405
+
406
+ # The type of string formatting that logging methods do. `old` means using %
407
+ # formatting, `new` is for `{}` formatting.
408
+ logging-format-style=old
409
+
410
+ # Logging modules to check that the string format arguments are in logging
411
+ # function parameter format.
412
+ logging-modules=logging
413
+
414
+
415
+ [MESSAGES CONTROL]
416
+
417
+ # Only show warnings with the listed confidence levels. Leave empty to show
418
+ # all. Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE,
419
+ # UNDEFINED.
420
+ confidence=HIGH,
421
+ CONTROL_FLOW,
422
+ INFERENCE,
423
+ INFERENCE_FAILURE,
424
+ UNDEFINED
425
+
426
+ # Disable the message, report, category or checker with the given id(s). You
427
+ # can either give multiple identifiers separated by comma (,) or put this
428
+ # option multiple times (only on the command line, not in the configuration
429
+ # file where it should appear only once). You can also use "--disable=all" to
430
+ # disable everything first and then re-enable specific checks. For example, if
431
+ # you want to run only the similarities checker, you can use "--disable=all
432
+ # --enable=similarities". If you want to run only the classes checker, but have
433
+ # no Warning level messages displayed, use "--disable=all --enable=classes
434
+ # --disable=W".
435
+ disable=raw-checker-failed,
436
+ bad-inline-option,
437
+ locally-disabled,
438
+ file-ignored,
439
+ suppressed-message,
440
+ useless-suppression,
441
+ deprecated-pragma,
442
+ use-implicit-booleaness-not-comparison-to-string,
443
+ use-implicit-booleaness-not-comparison-to-zero,
444
+ use-symbolic-message-instead
445
+
446
+ # Enable the message, report, category or checker with the given id(s). You can
447
+ # either give multiple identifier separated by comma (,) or put this option
448
+ # multiple time (only on the command line, not in the configuration file where
449
+ # it should appear only once). See also the "--disable" option for examples.
450
+ enable=
451
+
452
+
453
+ [METHOD_ARGS]
454
+
455
+ # List of qualified names (i.e., library.method) which require a timeout
456
+ # parameter e.g. 'requests.api.get,requests.api.post'
457
+ timeout-methods=requests.api.delete,requests.api.get,requests.api.head,requests.api.options,requests.api.patch,requests.api.post,requests.api.put,requests.api.request
458
+
459
+
460
+ [MISCELLANEOUS]
461
+
462
+ # List of note tags to take in consideration, separated by a comma.
463
+ notes=FIXME,
464
+ XXX,
465
+ TODO
466
+
467
+ # Regular expression of note tags to take in consideration.
468
+ notes-rgx=
469
+
470
+
471
+ [REFACTORING]
472
+
473
+ # Maximum number of nested blocks for function / method body
474
+ max-nested-blocks=5
475
+
476
+ # Complete name of functions that never returns. When checking for
477
+ # inconsistent-return-statements if a never returning function is called then
478
+ # it will be considered as an explicit return statement and no message will be
479
+ # printed.
480
+ never-returning-functions=sys.exit,argparse.parse_error
481
+
482
+ # Let 'consider-using-join' be raised when the separator to join on would be
483
+ # non-empty (resulting in expected fixes of the type: ``"- " + " -
484
+ # ".join(items)``)
485
+ suggest-join-with-non-empty-separator=yes
486
+
487
+
488
+ [REPORTS]
489
+
490
+ # Python expression which should return a score less than or equal to 10. You
491
+ # have access to the variables 'fatal', 'error', 'warning', 'refactor',
492
+ # 'convention', and 'info' which contain the number of messages in each
493
+ # category, as well as 'statement' which is the total number of statements
494
+ # analyzed. This score is used by the global evaluation report (RP0004).
495
+ evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10))
496
+
497
+ # Template used to display messages. This is a python new-style format string
498
+ # used to format the message information. See doc for all details.
499
+ msg-template=
500
+
501
+ # Set the output format. Available formats are: 'text', 'parseable',
502
+ # 'colorized', 'json2' (improved json format), 'json' (old json format), msvs
503
+ # (visual studio) and 'github' (GitHub actions). You can also give a reporter
504
+ # class, e.g. mypackage.mymodule.MyReporterClass.
505
+ output-format=github
506
+
507
+ # Tells whether to display a full report or only the messages.
508
+ reports=no
509
+
510
+ # Activate the evaluation score.
511
+ score=yes
512
+
513
+
514
+ [SIMILARITIES]
515
+
516
+ # Comments are removed from the similarity computation
517
+ ignore-comments=yes
518
+
519
+ # Docstrings are removed from the similarity computation
520
+ ignore-docstrings=yes
521
+
522
+ # Imports are removed from the similarity computation
523
+ ignore-imports=yes
524
+
525
+ # Signatures are removed from the similarity computation
526
+ ignore-signatures=yes
527
+
528
+ # Minimum lines number of a similarity.
529
+ min-similarity-lines=4
530
+
531
+
532
+ [SPELLING]
533
+
534
+ # Limits count of emitted suggestions for spelling mistakes.
535
+ max-spelling-suggestions=4
536
+
537
+ # Spelling dictionary name. No available dictionaries : You need to install
538
+ # both the python package and the system dependency for enchant to work.
539
+ spelling-dict=
540
+
541
+ # List of comma separated words that should be considered directives if they
542
+ # appear at the beginning of a comment and should not be checked.
543
+ spelling-ignore-comment-directives=fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:
544
+
545
+ # List of comma separated words that should not be checked.
546
+ spelling-ignore-words=
547
+
548
+ # A path to a file that contains the private dictionary; one word per line.
549
+ spelling-private-dict-file=
550
+
551
+ # Tells whether to store unknown words to the private dictionary (see the
552
+ # --spelling-private-dict-file option) instead of raising a message.
553
+ spelling-store-unknown-words=no
554
+
555
+
556
+ [STRING]
557
+
558
+ # This flag controls whether inconsistent-quotes generates a warning when the
559
+ # character used as a quote delimiter is used inconsistently within a module.
560
+ check-quote-consistency=no
561
+
562
+ # This flag controls whether the implicit-str-concat should generate a warning
563
+ # on implicit string concatenation in sequences defined over several lines.
564
+ check-str-concat-over-line-jumps=no
565
+
566
+
567
+ [TYPECHECK]
568
+
569
+ # List of decorators that produce context managers, such as
570
+ # contextlib.contextmanager. Add to this list to register other decorators that
571
+ # produce valid context managers.
572
+ contextmanager-decorators=contextlib.contextmanager
573
+
574
+ # List of members which are set dynamically and missed by pylint inference
575
+ # system, and so shouldn't trigger E1101 when accessed. Python regular
576
+ # expressions are accepted.
577
+ generated-members=
578
+
579
+ # Tells whether to warn about missing members when the owner of the attribute
580
+ # is inferred to be None.
581
+ ignore-none=yes
582
+
583
+ # This flag controls whether pylint should warn about no-member and similar
584
+ # checks whenever an opaque object is returned when inferring. The inference
585
+ # can return multiple potential results while evaluating a Python object, but
586
+ # some branches might not be evaluated, which results in partial inference. In
587
+ # that case, it might be useful to still emit no-member and other checks for
588
+ # the rest of the inferred objects.
589
+ ignore-on-opaque-inference=yes
590
+
591
+ # List of symbolic message names to ignore for Mixin members.
592
+ ignored-checks-for-mixins=no-member,
593
+ not-async-context-manager,
594
+ not-context-manager,
595
+ attribute-defined-outside-init
596
+
597
+ # List of class names for which member attributes should not be checked (useful
598
+ # for classes with dynamically set attributes). This supports the use of
599
+ # qualified names.
600
+ ignored-classes=optparse.Values,thread._local,_thread._local,argparse.Namespace
601
+
602
+ # Show a hint with possible names when a member name was not found. The aspect
603
+ # of finding the hint is based on edit distance.
604
+ missing-member-hint=yes
605
+
606
+ # The maximum edit distance a name should have in order to be considered a
607
+ # similar match for a missing member name.
608
+ missing-member-hint-distance=1
609
+
610
+ # The total number of similar names that should be taken in consideration when
611
+ # showing a hint for a missing member.
612
+ missing-member-max-choices=1
613
+
614
+ # Regex pattern to define which classes are considered mixins.
615
+ mixin-class-rgx=.*[Mm]ixin
616
+
617
+ # List of decorators that change the signature of a decorated function.
618
+ signature-mutators=
619
+
620
+
621
+ [VARIABLES]
622
+
623
+ # List of additional names supposed to be defined in builtins. Remember that
624
+ # you should avoid defining new builtins when possible.
625
+ additional-builtins=
626
+
627
+ # Tells whether unused global variables should be treated as a violation.
628
+ allow-global-unused-variables=yes
629
+
630
+ # List of names allowed to shadow builtins
631
+ allowed-redefined-builtins=
632
+
633
+ # List of strings which can identify a callback function by name. A callback
634
+ # name must start or end with one of those strings.
635
+ callbacks=cb_,
636
+ _cb
637
+
638
+ # A regular expression matching the name of dummy variables (i.e. expected to
639
+ # not be used).
640
+ dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
641
+
642
+ # Argument names that match this expression will be ignored.
643
+ ignored-argument-names=_.*|^ignored_|^unused_
644
+
645
+ # Tells whether we should check for unused import in __init__ files.
646
+ init-import=no
647
+
648
+ # List of qualified module names which can have objects that can redefine
649
+ # builtins.
650
+ redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pysips
3
- Version: 0.0.0
3
+ Version: 0.1.0
4
4
  Summary: A python package for symbolic inference via posterior sampling.
5
5
  Author-email: Geoffrey Bomarito <geoffrey.f.bomarito@nasa.gov>, Patrick Leser <patrick.e.leser@nasa.gov>
6
6
  License-Expression: NASA-1.3
@@ -44,8 +44,6 @@ PySIPS implements a Sequential Monte Carlo (SMC) framework for Bayesian symbolic
44
44
 
45
45
  ## Installation
46
46
 
47
- (Coming Soon!)
48
-
49
47
  ```bash
50
48
  pip install pysips
51
49
  ```
@@ -23,8 +23,6 @@ PySIPS implements a Sequential Monte Carlo (SMC) framework for Bayesian symbolic
23
23
 
24
24
  ## Installation
25
25
 
26
- (Coming Soon!)
27
-
28
26
  ```bash
29
27
  pip install pysips
30
28
  ```
@@ -0,0 +1,188 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "52da8f4f",
6
+ "metadata": {},
7
+ "source": [
8
+ "# PySIPS Usage Example\n",
9
+ "\n",
10
+ "### Start by generating some data: $ y= x^2 + \\text{noise} $"
11
+ ]
12
+ },
13
+ {
14
+ "cell_type": "code",
15
+ "execution_count": null,
16
+ "id": "7aa382c2",
17
+ "metadata": {},
18
+ "outputs": [],
19
+ "source": [
20
+ "import numpy as np\n",
21
+ "import matplotlib.pyplot as plt\n",
22
+ "\n",
23
+ "np.random.seed(42)\n",
24
+ "X = np.linspace(-3, 3, 100).reshape(-1, 1)\n",
25
+ "y = X[:, 0]**2 + np.random.normal(0, 0.1, size=X.shape[0])"
26
+ ]
27
+ },
28
+ {
29
+ "cell_type": "markdown",
30
+ "id": "171c6e3c",
31
+ "metadata": {},
32
+ "source": [
33
+ "Do a train/test split"
34
+ ]
35
+ },
36
+ {
37
+ "cell_type": "code",
38
+ "execution_count": null,
39
+ "id": "acbf08b6",
40
+ "metadata": {},
41
+ "outputs": [],
42
+ "source": [
43
+ "from sklearn.model_selection import train_test_split\n",
44
+ "\n",
45
+ "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)\n",
46
+ "\n",
47
+ "plt.plot(X_train, y_train, '.', label=\"Train Data\")\n",
48
+ "plt.plot(X_test, y_test, '.', label=\"Test Data\")\n",
49
+ "plt.xlabel(\"x\")\n",
50
+ "plt.ylabel(\"y\")\n",
51
+ "plt.legend()"
52
+ ]
53
+ },
54
+ {
55
+ "cell_type": "markdown",
56
+ "id": "f6ce5181",
57
+ "metadata": {},
58
+ "source": [
59
+ "### Fitting with PySIPS\n",
60
+ "\n",
61
+ "Start by creating the regressor "
62
+ ]
63
+ },
64
+ {
65
+ "cell_type": "code",
66
+ "execution_count": null,
67
+ "id": "8a56251b",
68
+ "metadata": {},
69
+ "outputs": [],
70
+ "source": [
71
+ "from pysips import PysipsRegressor\n",
72
+ "\n",
73
+ "regressor = PysipsRegressor(\n",
74
+ " # the mathematical operations that can be used in equations\n",
75
+ " operators=['+', '-', '*'], \n",
76
+ " \n",
77
+ " # a complexity limit for equations\n",
78
+ " max_complexity=12, \n",
79
+ "\n",
80
+ " # the number of equations that will represent the model posterior \n",
81
+ " # similar to a population size in a genetic algorithm\n",
82
+ " # computation times increase with this value, effectiveness does too\n",
83
+ " num_particles=100, \n",
84
+ "\n",
85
+ " # length of MCMC chains between SMC target distributions\n",
86
+ " # computation times increase with this value\n",
87
+ " # effectiveness also increases (but may saturate at larger values)\n",
88
+ " num_mcmc_samples=10,\n",
89
+ "\n",
90
+ " # to control randomness\n",
91
+ " random_state=42\n",
92
+ ")"
93
+ ]
94
+ },
95
+ {
96
+ "cell_type": "markdown",
97
+ "id": "7f3cd12a",
98
+ "metadata": {},
99
+ "source": [
100
+ "Fit the regressor to the training data"
101
+ ]
102
+ },
103
+ {
104
+ "cell_type": "code",
105
+ "execution_count": null,
106
+ "id": "00d70dd6",
107
+ "metadata": {},
108
+ "outputs": [],
109
+ "source": [
110
+ "regressor.fit(X_train, y_train)"
111
+ ]
112
+ },
113
+ {
114
+ "cell_type": "markdown",
115
+ "id": "b658cf7e",
116
+ "metadata": {},
117
+ "source": [
118
+ "See how good the fit is"
119
+ ]
120
+ },
121
+ {
122
+ "cell_type": "code",
123
+ "execution_count": null,
124
+ "id": "7b135247",
125
+ "metadata": {},
126
+ "outputs": [],
127
+ "source": [
128
+ "from sklearn.metrics import r2_score\n",
129
+ "\n",
130
+ "expression = regressor.get_expression()y_pred = regressor.predict(X_test)\n",
131
+ "print(f\"Discovered expression: {expression}\")\n",
132
+ "print(f\"R² score: {r2_score(y_test, y_pred):.4f}\")"
133
+ ]
134
+ },
135
+ {
136
+ "cell_type": "markdown",
137
+ "id": "3f9bec7f",
138
+ "metadata": {},
139
+ "source": [
140
+ "Plot the expression"
141
+ ]
142
+ },
143
+ {
144
+ "cell_type": "code",
145
+ "execution_count": null,
146
+ "id": "5b648176",
147
+ "metadata": {},
148
+ "outputs": [],
149
+ "source": [
150
+ "plt.plot(X_train, y_train, '.', label=\"Train Data\")\n",
151
+ "plt.plot(X_test, y_test, '.', label=\"Test Data\")\n",
152
+ "plt.plot(X, regressor.predict(X), '-', label=expression)\n",
153
+ "plt.xlabel(\"x\")\n",
154
+ "plt.ylabel(\"y\")\n",
155
+ "plt.legend()"
156
+ ]
157
+ },
158
+ {
159
+ "cell_type": "code",
160
+ "execution_count": null,
161
+ "id": "5abf044d",
162
+ "metadata": {},
163
+ "outputs": [],
164
+ "source": []
165
+ }
166
+ ],
167
+ "metadata": {
168
+ "kernelspec": {
169
+ "display_name": "bayesr",
170
+ "language": "python",
171
+ "name": "python3"
172
+ },
173
+ "language_info": {
174
+ "codemirror_mode": {
175
+ "name": "ipython",
176
+ "version": 3
177
+ },
178
+ "file_extension": ".py",
179
+ "mimetype": "text/x-python",
180
+ "name": "python",
181
+ "nbconvert_exporter": "python",
182
+ "pygments_lexer": "ipython3",
183
+ "version": "3.13.2"
184
+ }
185
+ },
186
+ "nbformat": 4,
187
+ "nbformat_minor": 5
188
+ }
@@ -1,3 +1,10 @@
1
+ [build-system]
2
+ requires = [
3
+ "setuptools>=42",
4
+ "setuptools-scm>=8",
5
+ ]
6
+ build-backend = "setuptools.build_meta"
7
+
1
8
  [project]
2
9
  name = "pysips"
3
10
  keywords = ["symbolic regression"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pysips
3
- Version: 0.0.0
3
+ Version: 0.1.0
4
4
  Summary: A python package for symbolic inference via posterior sampling.
5
5
  Author-email: Geoffrey Bomarito <geoffrey.f.bomarito@nasa.gov>, Patrick Leser <patrick.e.leser@nasa.gov>
6
6
  License-Expression: NASA-1.3
@@ -44,8 +44,6 @@ PySIPS implements a Sequential Monte Carlo (SMC) framework for Bayesian symbolic
44
44
 
45
45
  ## Installation
46
46
 
47
- (Coming Soon!)
48
-
49
47
  ```bash
50
48
  pip install pysips
51
49
  ```
@@ -1,6 +1,12 @@
1
+ .gitignore
2
+ .pylintrc
1
3
  LICENSE
2
4
  README.md
3
5
  pyproject.toml
6
+ .github/workflows/pylint.yml
7
+ .github/workflows/pypi.yml
8
+ .github/workflows/pytest.yml
9
+ demos/basic_usage.ipynb
4
10
  pysips/__init__.py
5
11
  pysips/crossover_proposal.py
6
12
  pysips/laplace_nmll.py
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes