{"id":13720089,"url":"https://github.com/fpicetti/occamypy","last_synced_at":"2026-01-14T08:00:42.497Z","repository":{"id":38239564,"uuid":"278045710","full_name":"fpicetti/occamypy","owner":"fpicetti","description":"Python library for solving large-scale inverse problems","archived":false,"fork":false,"pushed_at":"2023-08-04T04:37:37.000Z","size":18334,"stargazers_count":56,"open_issues_count":9,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-20T02:55:50.345Z","etag":null,"topics":["cluster-computing","multiscale","optimization","optimization-algorithm-library","optimization-algorithms"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fpicetti.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-07-08T09:23:12.000Z","updated_at":"2025-06-21T10:23:22.000Z","dependencies_parsed_at":"2024-01-14T17:04:10.122Z","dependency_job_id":"ee7ffa89-1767-4057-81ca-05946a84422d","html_url":"https://github.com/fpicetti/occamypy","commit_stats":{"total_commits":175,"total_committers":6,"mean_commits":"29.166666666666668","dds":0.2857142857142857,"last_synced_commit":"f741727ef777b70bb8d721b40a930d8ebecb37b5"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/fpicetti/occamypy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpicetti%2Foccamypy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpicetti%2Foccamypy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpicetti%2Foccamypy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpicetti%2Foccamypy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fpicetti","download_url":"https://codeload.github.com/fpicetti/occamypy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpicetti%2Foccamypy/sbom","scorecard":{"id":408508,"data":{"date":"2025-08-11","repo":{"name":"github.com/fpicetti/occamypy","commit":"f741727ef777b70bb8d721b40a930d8ebecb37b5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":3,"reason":"Found 5/14 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.2.0 not signed: https://api.github.com/repos/fpicetti/occamypy/releases/65303380","Warn: release artifact v0.1.5 not signed: https://api.github.com/repos/fpicetti/occamypy/releases/65263004","Warn: release artifact v0.1.4 not signed: https://api.github.com/repos/fpicetti/occamypy/releases/64622478","Warn: release artifact v0.2.0 does not have provenance: https://api.github.com/repos/fpicetti/occamypy/releases/65303380","Warn: release artifact v0.1.5 does not have provenance: https://api.github.com/repos/fpicetti/occamypy/releases/65263004","Warn: release artifact v0.1.4 does not have provenance: https://api.github.com/repos/fpicetti/occamypy/releases/64622478"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T21:59:52.009Z","repository_id":38239564,"created_at":"2025-08-18T21:59:52.009Z","updated_at":"2025-08-18T21:59:52.009Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cluster-computing","multiscale","optimization","optimization-algorithm-library","optimization-algorithms"],"created_at":"2024-08-03T01:00:59.653Z","updated_at":"2026-01-14T08:00:42.402Z","avatar_url":"https://github.com/fpicetti.png","language":"Jupyter Notebook","funding_links":[],"categories":["Software"],"sub_categories":["Simulation and Modelling"],"readme":"![occamypy](readme_img/logo192.png)\n\n# OccamyPy: an object-oriented optimization framework for small- and large-scale problems\n\nWe present an object-oriented optimization framework that can be employed to solve\nsmall- and large-scale problems based on the concept of vectors and operators.\nBy using such a strategy, we implement different iterative optimization algorithms\nthat can be used in combination with architecture-independent vectors and operators,\nallowing the minimization of single-machine or cluster-based problems with a unique codebase.\nWe implement a Python library following the described structure with a user-friendly interface.\nWe demonstrate its flexibility and scalability on multiple inverse problems,\nwhere convex and non-convex objective functions are optimized with different iterative algorithms.\n\n### Installation\nPreferred way is through Python Package Index:\n```bash\npip install occamypy\n```\nIn order to have Cupy-based vectors and operators, you should install also [Cupy](https://docs.cupy.dev/en/stable/install.html#install-cupy) and [cuSIGNAL](https://github.com/rapidsai/cusignal#installation).\nThey are not included in this installation as they are dependent on the target CUDA device and compiler.\n\nAs this library strongly relies on Numpy, we suggest installing OccamyPy in a conda environment like [this](./envs/env.yml) with:\n```bash\nconda env create -n MYENV -f env.yml\n```\n\n### History\nThis library was initially developed at\n[Stanford Exploration Project](http://zapad.stanford.edu/ettore88/python-solver)\nfor solving large scale seismic problems.\nInspired by Equinor's [PyLops](https://github.com/equinor/pylops)\nwe publish this library as our contribution to scientific community.\n\n## How it works\nThis framework allows for the definition of linear and non-linear mapping functions that\noperate on abstract vector objects that can be defined to use\nheterogeneous computational resources, from personal laptops to HPC environments.\n\n- **vector** class: this is the building block for handling data. It contains the required\nmathematical operations such as norm, scaling, dot-product, sum, point-wise multiplication.\nThese methods can be implemented using existing libraries (e.g., Numpy, Cupy, PyTorch) or\nuser-defined ones (e.g., [SEPLib](http://sepwww.stanford.edu/doku.php?id=sep:software:seplib)).\nSee the [`vector`](./occamypy/vector) subpackage for details and implementations.\n\n- **operator** class: a mapping function between a `domain` vector and a `range` vector.\nIt  can be linear and non-linear.\nLinear operators require the definition of both the forward and adjoint functions;\nnon-linear operators require the forward mapping and its Jacobian operator.\nSee the [`operator`](./occamypy/operator) subpackage for details and implementations.\n\n- **problem** class: it represents the objective function related to  an optimization problem.\nDefined upon operators (e.g., modeling and regularization) and vectors (observed data, priors).\nIt contains the methods for objective function and gradient computation, as our solvers are mainly gradient based.\nSee the [`problem`](./occamypy/problem) subpackage for details and implementations.\n\n- **solver** class: it aims at finding the solution to a problem by employing methods\ndefined within the vector, operator and problem classes.\nAdditionally, it allows to restart an optimization method from an intermediate result\nwritten as serialized objects on permanent computer memory.\nWe have a number of linear and nonlinear solver, along with some stepper algorithms.\nSee the [`solver`](./occamypy/solver) subpackage for details and implementations.\nSolvers come with a Logger object that we found helpful for saving large-scale inversions. Check it out in the tutorials!\n\n### Features at a glance\n\n| vector engines | operators | problems | solvers |\n|-|-|-|-|\n| numpy | linear      | least squares                   | Conjugate Gradient           |\n| cupy  | nonlinear   | symmetric least squares         | Steepest Descent             |\n| torch | distributed | L2-reg least squares            | LSQR                         |\n|       |             | LASSO                           | symmetric Conjugate Gradient |\n|       |             | generalized LASSO               | nonlinear Conjugate Gradient |\n|       |             | nonlinear least squares         | L-BFGS                       |\n|       |             | L2-reg nonlinear least squares  | L-BFGS-B                     |\n|       |             | regularized Variable Projection | Truncated Newton             |\n|       |             |                                 | Markov Chain Monte Carlo     |\n|       |             |                                 | ISTA and Fast-ISTA           |\n|       |             |                                 | ISTC (ISTA with cooling)     |\n|       |             |                                 | Split-Bregman                |\n\n### Scalability\nThe main objective of the described framework and implemented library is to solve large-scale inverse problems.\nAny vector and operator can be split into blocks to be distributed to multiple nodes.\nThis is achieved via custom [Dask](https://dask.org/) vector and operator classes.\nSee the [`dask`](./occamypy/dask) subpackage for details and implementations.\n\n### Tutorials\nWe provide some [tutorials](./tutorials) that demonstrate the flexibility of occamypy.\nPlease refer to them as a good starting point for developing your own code.\nIf you have a good application example, contact us! We will be happy to see OccamyPy in action.\n\nCheck out the [tutorial](https://curvenote.com/@swung/transform-2022-occamypy-an-oo-optimizaton-library/overview) we gave at SWUNG's Transform 2022!\n\n### Contributing\nFollow the following instructions and read carefully the [CONTRIBUTING](CONTRIBUTING.md) file before getting started.\n\nWe have a lot of ideas that might be helpful to scientists!\nWe are currently working on:\n* wrapping linear operators to PyTorch optimizers: see the [LS-RTM tutorial](./tutorials/2D%20LS-RTM%20with%20devito%20and%20Automatic%20Differentiation.ipynb)!\nThis can be useful for using neural networks and operators (i.e., deep priors and physical modeling).\n* using PyTorch's [functorch](https://github.com/pytorch/functorch) library to compute the Jacobian-vector product of nonlinear operators: see the [first step](tutorials/Automatic%20Differentiation%20for%20nonlinear%20operators.ipynb)!\n* implement computation-demanding operators natively in OccamyPy, so that they can be used on CPU/GPU and HPC clusters.\n\n### Authors\n - [Ettore Biondi](https://github.com/biondiettore)\n - [Guillame Barnier](https://github.com/gbarnier)\n - [Robert Clapp](http://zapad.stanford.edu/bob)\n - [Francesco Picetti](https://github.com/fpicetti)\n - [Stuart Farris](http://zapad.stanford.edu/sfarris)\n\n### Citation\n```\n@article{biondi2021object,\n  title = {An object-oriented optimization framework for large-scale inverse problems},\n  author = {Ettore Biondi and Guillaume Barnier and Robert G. Clapp and Francesco Picetti and Stuart Farris},\n  journal = {Computers \u0026 Geosciences},\n  volume = {154},\n  pages = {104790},\n  year = {2021},\n  doi = {https://doi.org/10.1016/j.cageo.2021.104790},\n}\n```\n\n### Publications using OccamyPy\n\n* E. Biondi, G. Barnier, R. G. Clapp, F. Picetti, and S. Farris. \"Object-Oriented Optimization for Small- and Large-Scale Seismic Inversion Procedures\", in _European Association of Geophysicists and Engineers (EAGE) Workshop on High Performance Computing for Upstream_, 2021. [link](https://doi.org/10.3997/2214-4609.202181003).\n* E. Biondi, G. Barnier, R. G. Clapp, F. Picetti, and S. Farris. \"Object-oriented optimization for large-scale seismic inversion of ocean-bottom-node pressure data\", in _International Conference on Parallel Computational Fluid Dynamics (ParCFD)_, 2021. [link](https://parcfd2020.sciencesconf.org/345756).\n\nIf you have one to add, reach us out!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffpicetti%2Foccamypy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffpicetti%2Foccamypy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffpicetti%2Foccamypy/lists"}