semvec/pypi-packages huggingface dataset:
OnePuzzle 0.2.3
Solve puzzle "A Puzzle A Day", get one or all result, show in graphical PyQt5
License: MIT
Requires Python: >=3.6
Keywords: puzzle

# A Puzzle A Day

[![Build Status](https://img.shields.io/travis/windard/OnePuzzle)](https://travis-ci.com/github/windard/OnePuzzle)
[![Total Lines](https://img.shields.io/tokei/lines/github/windard/OnePuzzle)](https://github.com/windard/OnePuzzle)
[![codecov](https://codecov.io/gh/windard/OnePuzzle/branch/master/graph/badge.svg?token=JKFqVmzvLm)](https://codecov.io/gh/windard/OnePuzzle)
[![MIT](https://img.shields.io/github/license/windard/OnePuzzle)](https://github.com/windard/OnePuzzle/blob/master/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/OnePuzzle)](https://pypi.org/project/OnePuzzle/)
[![Author](https://img.shields.io/badge/author-windard-359BE1)](https://windard.com)

一天一个谜，一个谜一天

## install

```
pip install OnePuzzle
```

## usage

```
$ one_puzzle -h
Usage: one_puzzle [OPTIONS] MONTH DAY

Options:
  -h, --help   Show this message and exit.
  -d, --debug  show debug message.
  -a, --all    get all result.
  -n, --nox    no screen show.
```

## example

![](https://windard-blog.oss-cn-beijing.aliyuncs.com/uTools_1633677947082.png)

## changelog

- 0.1.0: 功能基本完成
- 0.1.1: 小的修复升级
- 0.2.0: 减少遍历次数，加快解谜速度
- 0.2.1: 增加测试，删减无用代码
NumbaMinpack 0.1.3
Python wrapper of Minpack (root finding) which can be called from within numba functions.
License: MIT
Requires Python: >3.6

# NumbaMinpack

`NumbaMinpack` is a python wrapper to [Minpack](https://en.wikipedia.org/wiki/MINPACK), which is for solving systems of non-linear equations.

This package is very similar to `scipy.optimize.root` ([see here](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.root.html)), when you set `method = 'lm'` or `method = 'hybr'`. But, the problem with `scipy.optimize.root`, is that it can not be used within numba jit-compiled python functions. In contrast, `NumbaMinpack` can be used within a numba compiled function. For example, check out `comparison2scipy.ipynb`.

Right now, `NumbaMinpack` wraps the following Minpack algorithms 
- `lmdif` (Levenberg-Marquardt) with a finite-differenced, non-analytical, jacobian.
- `hybrd` (modified Powell method) with a finite-differenced, non-analytical, jacobian. 

## Installation

You must have a fortran compiler (On Mac install with `brew install gcc`).

After satisfying the dependencies, install with the pip

```
python -m pip install NumbaMinpack
```

## Basic usage

```python
from NumbaMinpack import lmdif, hybrd, minpack_sig
from numba import njit, cfunc
import numpy as np

# System of equations must look like this. Returns nothing!
@cfunc(minpack_sig)
def myfunc(x, fvec, args):
    fvec[0] = x[0]**2 - args[0]
    fvec[1] = x[1]**2 - args[1]
    
funcptr = myfunc.address # address in memory to myfunc

x_init = np.array([10.0,10.0]) # initial conditions
neqs = 2 # number of equations
args = np.array([30.0,8.0]) # data you want to pass to myfunc
xsol, fvec, success, info = lmdif(funcptr, x_init, neqs, args) # solve with lmdif
xsol, fvec, success, info = hybrd(funcptr, x_init, args) # OR solve with hybrd
# xsol = solution
# fvec = function evaluated at solution
# success = True/False
# info = an integer. See src/lmdif1.f for what it means.
```

Note, that either `lmdif` or `hybrd` can be called within a jit-compiled numba function:
```python
@njit
def test()
    return hybrd(funcptr, x_init, args)
sol = test() # this works!!! :)

@njit
def test_sp():
    sol_sp = scipy.optimize.root(myfunc_scipy,x_init,method='hybr')
    return sol_sp
sol_sp = test_sp() # this DOES NOT WORK :(
```

## Warning

Using `NumbaMinpack` is like using C or Fortran: **You will not** be notified if you write or read beyond an array. For example,

```python
@cfunc(minpack_sig)
def myfunc(x, fvec, args):
    fvec[0] = x[0]**2 - args[0]
    fvec[1] = x[1]**2 - args[1]
funcptr = myfunc.address

x_init = np.array([10.0,10.0])
neqs = 2 
args = np.array([30.0]) # Array is too short!!!! 
sol = lmdif(funcptr, x_init, neqs, args) 
```

Notice, that `args`, is only length 1, but in `myfunc` we try to access `args` assuming it as 2 elements. **No error** will be thrown, and you will read from beyond the end of `args`, and the solution will be garbage. If you read far enough beyond then end an array, it will probably crash your program.
django-template-standalone 0.1.0
Simple setup to use django's template engine for non-django applications.
License: MIT
Keywords: django,django template,django template engine

# django-template-standalone

Simple setup to use django's template engine for non-django applications.

## Install

```
pip install django-template-standalone
```

## Usage

```
from django_template_standalone import render

from django_template_standalone import register_dirs
from django_template_standalone import render_template


msg = render("hello {{name}}, how are you?", {"name": "Cissie"})
assert msg == "hello Cissie, how are you?"

reigster_dirs("./templates/")
html = render_template("index.html", {"title": "This is an index Page"})
assert html == "<h1>This is an index Page</h1>"


```

Content of `./templates/index.html` is:

```
<h1>{{title}}</h1>
```

## Methods

- `render(template_text, context)`: Render a template text with context.
- `render_template(template_filename, context)`: Render a template file with context.
- `reigster_dirs(*dirs)`: Add template dirs.
- `register_apps(*apps)`: Add template apps.
- `setup(template_dirs, apps)`: Setup django's template engine with template dirs and apps.

**Note:**

- When using `reigster_apps` method or using `apps` parameter in `setup` method, there must be a `templates` sub-folder under the APP's root folder.
- The `setup` method will be auto called in other functions, so you really don't need to call it manually.


## Releases

### v0.1.0 2021/11/30

- First release.