From 576548eff9613689bdf63508daf8cfc1f6428d42 Mon Sep 17 00:00:00 2001 From: Liam Bindle Date: Mon, 4 Sep 2023 14:06:25 -0700 Subject: [PATCH] Rename to sequence (#1) * refactoring for collagen->sequence * changed pypi name to 'seq' --- .gitattributes | 2 +- .github/workflows/gh_pages.yml | 4 +- README.md | 26 +- collagen/standard/__init__.py | 7 - collagen/standard/resources/__init__.py | 7 - docs/api.md | 42 +- docs/assets/16.png | Bin 0 -> 463 bytes docs/assets/32.png | Bin 0 -> 821 bytes docs/assets/48.png | Bin 0 -> 1183 bytes docs/assets/favicon.png | 0 docs/assets/favicon.svg | 66 ++ docs/assets/sequence.png | Bin 0 -> 9231 bytes docs/assets/sequence.svg | 901 ++++++++++++++++++ docs/assets/sequence_white_background.png | Bin 0 -> 7990 bytes docs/custom_theme/partials/favicon.html | 1 + docs/custom_theme/partials/top-nav/top.html | 14 + docs/extra.css | 2 +- docs/img/favicon.ico | Bin 0 -> 15086 bytes docs/sequence.svg | 901 ++++++++++++++++++ docs/std.md | 74 +- mkdocs.yml | 5 +- .../{collagen => sequence}/__init__.py | 0 .../{collagen => sequence}/handler.py | 18 +- .../templates/terminal/metadata.html | 0 .../templates/terminal/ops.html | 4 +- {collagen => sequence}/__init__.py | 0 {collagen => sequence}/_version.py | 2 +- {collagen => sequence}/cli.py | 4 +- sequence/standard/__init__.py | 7 + {collagen => sequence}/standard/branching.py | 14 +- {collagen => sequence}/standard/loops.py | 22 +- {collagen => sequence}/standard/operators.py | 62 +- {collagen => sequence}/standard/other.py | 14 +- sequence/standard/resources/__init__.py | 7 + .../standard/resources/file.py | 6 +- .../standard/resources/hson.py | 14 +- .../standard/resources/json.py | 14 +- .../standard/resources/json5.py | 14 +- .../standard/resources/methods.py | 14 +- .../standard/resources/variable.py | 26 +- .../standard/stack_operations.py | 26 +- {collagen => sequence}/standard/types.py | 14 +- {collagen => sequence}/vm.py | 10 +- setup.cfg | 20 +- tests/imports.py | 34 +- tests/json/test-recurse.json | 2 +- tests/{test_zvm.py => test_svm.py} | 6 +- 47 files changed, 2145 insertions(+), 261 deletions(-) delete mode 100644 collagen/standard/__init__.py delete mode 100644 collagen/standard/resources/__init__.py create mode 100644 docs/assets/16.png create mode 100644 docs/assets/32.png create mode 100644 docs/assets/48.png create mode 100644 docs/assets/favicon.png create mode 100644 docs/assets/favicon.svg create mode 100644 docs/assets/sequence.png create mode 100644 docs/assets/sequence.svg create mode 100644 docs/assets/sequence_white_background.png create mode 100644 docs/custom_theme/partials/favicon.html create mode 100644 docs/custom_theme/partials/top-nav/top.html create mode 100644 docs/img/favicon.ico create mode 100644 docs/sequence.svg rename mkdocstrings_handlers/{collagen => sequence}/__init__.py (100%) rename mkdocstrings_handlers/{collagen => sequence}/handler.py (95%) rename mkdocstrings_handlers/{collagen => sequence}/templates/terminal/metadata.html (100%) rename mkdocstrings_handlers/{collagen => sequence}/templates/terminal/ops.html (84%) rename {collagen => sequence}/__init__.py (100%) rename {collagen => sequence}/_version.py (99%) rename {collagen => sequence}/cli.py (58%) create mode 100644 sequence/standard/__init__.py rename {collagen => sequence}/standard/branching.py (91%) rename {collagen => sequence}/standard/loops.py (84%) rename {collagen => sequence}/standard/operators.py (87%) rename {collagen => sequence}/standard/other.py (87%) create mode 100644 sequence/standard/resources/__init__.py rename {collagen => sequence}/standard/resources/file.py (66%) rename {collagen => sequence}/standard/resources/hson.py (78%) rename {collagen => sequence}/standard/resources/json.py (73%) rename {collagen => sequence}/standard/resources/json5.py (78%) rename {collagen => sequence}/standard/resources/methods.py (86%) rename {collagen => sequence}/standard/resources/variable.py (74%) rename {collagen => sequence}/standard/stack_operations.py (86%) rename {collagen => sequence}/standard/types.py (81%) rename {collagen => sequence}/vm.py (98%) rename tests/{test_zvm.py => test_svm.py} (91%) diff --git a/.gitattributes b/.gitattributes index faa6966..1a845e7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -collagen/_version.py export-subst +sequence/_version.py export-subst diff --git a/.github/workflows/gh_pages.yml b/.github/workflows/gh_pages.yml index 75f4c1e..ab7a356 100644 --- a/.github/workflows/gh_pages.yml +++ b/.github/workflows/gh_pages.yml @@ -17,9 +17,9 @@ jobs: - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV - uses: actions/cache@v3 with: - key: mkdocs-collagen-${{ env.cache_id }} + key: mkdocs-sequence-${{ env.cache_id }} path: .cache restore-keys: | - mkdocs-collagen- + mkdocs-sequence- - run: pip install '.[docs]' - run: mkdocs gh-deploy --force diff --git a/README.md b/README.md index 0ea049b..958149f 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,14 @@ *Note: This documentation is a work in progress.* -Collagen is a library that lets you script Python by writing procedures in configuration file formats like JSON or YAML. +Sequence is a library that lets you script Python by writing procedures in configuration file formats like JSON or YAML. This is useful when you want to define the logic for generating some sort of output, like data or an image, in a configuration file. -In collagen, this type of configuration file is called a *procedure* and it defines a sequence of operations that do something. +In sequence, this type of configuration file is called a *procedure* and it defines a sequence of operations that do something. -Under the hood, collagen has a virtual stack machine, *CVM*, that runs procedures. +Under the hood, sequence has a virtual stack machine, *SVM*, that runs procedures. A procedure is a sequence of *operations*, where an operation is either another procedure (a subprocedure) or a *method*. -A method is a Python function that uses the `@cvm.method` decorator and methods are what provide basic functionality. -Methods and procedures pass data to each other by using CVM's stack, via pushing, popping, and swapping data on the stack. +A method is a Python function that uses the `@svm.method` decorator and methods are what provide basic functionality. +Methods and procedures pass data to each other by using SVM's stack, via pushing, popping, and swapping data on the stack. A *toolkit* is a Python package that provides a suite of methods. The *standard toolkit* (built-in) is a suite of turing-complete methods that provide the backbone for scripting logic in procedures (e.g., if blocks, while loops, string formatting, data resources, etc.). @@ -17,18 +17,18 @@ Additional functionality can be added by installing additional toolkits. ## About Stack Machines -If it isn't clear how operations pass data using the stack, a good way to get familiar with the concept is by playing around with an RPN calculator like [this](http://www.alcula.com/calculators/rpn/). Try calculating the hypotenuse of a triangle with side length of 3 and 4 using the Pythagorean Theorem (the answer is *3, Enter, X, Enter, 4, Enter, X, +, SQRT*). Every button-press is equivalent to an operation in collagen. +If it isn't clear how operations pass data using the stack, a good way to get familiar with the concept is by playing around with an RPN calculator like [this](http://www.alcula.com/calculators/rpn/). Try calculating the hypotenuse of a triangle with side length of 3 and 4 using the Pythagorean Theorem (the answer is *3, Enter, X, Enter, 4, Enter, X, +, SQRT*). Every button-press is equivalent to an operation in sequence. -The design of collagen took inspiration from these old RPN-style calculators as well as the +The design of sequence took inspiration from these old RPN-style calculators as well as the [FORTH](https://en.wikipedia.org/wiki/Forth_(programming_language)) programming language. -## Installing collagen -Collagen can be install using `pip`. The basic install supports procedures written in +## Installing sequence +Sequence can be install using `pip`. The basic install supports procedures written in JSON. ```console -$ pip install collagen +$ pip install sequence ``` It's oftentimes useful to add comments and use multi-line strings in procedures. @@ -36,11 +36,11 @@ This can be done by writing your procedures in a configuration file format that Additional configuration languages can be installed via the `json5`, `hson`, and/or `yaml` extras. ```console -$ pip install "collagen[json5,hson]" +$ pip install "sequence[json5,hson]" ``` -If you are developing a Collagen Toolkit (CTK), the `dev` and `docs` extras install the requirements for running tests and building documentation. +If you are developing a Sequence Toolkit (STK), the `dev` and `docs` extras install the requirements for running tests and building documentation. ```console -$ pip install "collagen[dev,docs]" +$ pip install "sequence[dev,docs]" ``` diff --git a/collagen/standard/__init__.py b/collagen/standard/__init__.py deleted file mode 100644 index 8c3b6d0..0000000 --- a/collagen/standard/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -import collagen.standard.branching -import collagen.standard.loops -import collagen.standard.operators -import collagen.standard.other -import collagen.standard.stack_operations -import collagen.standard.types -import collagen.standard.resources diff --git a/collagen/standard/resources/__init__.py b/collagen/standard/resources/__init__.py deleted file mode 100644 index 0b8cf31..0000000 --- a/collagen/standard/resources/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -import collagen.standard.resources.methods -import collagen.standard.resources.file -import collagen.standard.resources.hson -import collagen.standard.resources.json -import collagen.standard.resources.json5 -import collagen.standard.resources.hson -import collagen.standard.resources.variable diff --git a/docs/api.md b/docs/api.md index 1f1ebc9..935b48c 100644 --- a/docs/api.md +++ b/docs/api.md @@ -6,17 +6,17 @@ the methods you need for your scripting. To load your toolkit, include it in the
## Writing your own methods -A method is a Python function that uses the `@cvm.method` decorator. The decorator takes one argument, which is the name of the method. +A method is a Python function that uses the `@svm.method` decorator. The decorator takes one argument, which is the name of the method. -To create a method, write a Python function with one positional argument for the `cvm.State` which is the object you -use to interact with the Collagen Virtual Machine (CVM) for things like popping items from the stack. Any parameters for your method should +To create a method, write a Python function with one positional argument for the `svm.State` which is the object you +use to interact with the Sequence Virtual Machine (SVM) for things like popping items from the stack. Any parameters for your method should be keyword-only arguments (i.e., after the `*` in the signature). ```python -import collagen.vm as cvm +import sequence.vm as svm -@cvm.method("divide") -def my_divide(state: cvm.State, *, reciprocal: bool = False): +@svm.method("divide") +def my_divide(state: svm.State, *, reciprocal: bool = False): y = state.pop() x = state.pop() if reciprocal: @@ -30,12 +30,12 @@ Whatever your function returns is pushed to the stack, except for lists which ex
-## Using `cvm.State` +## Using `svm.State` -The `cvm.State` is the object you use to interact with the Collagen Virtual Machine (CVM). It's a simple object and it's functions are listed below +The `svm.State` is the object you use to interact with the Sequence Virtual Machine (SVM). It's a simple object and it's functions are listed below ```python -state: cvm.State +state: svm.State # pop/push data x = state.pop() # pops an item from the top-of-stack (TOS) @@ -54,21 +54,21 @@ exists = state.has("x", global_var=False) # checks if variable "x" exists ## Writing data methods To extend `get`, `put`, and `del` to work with your own data types you write Python functions to load, store, or delete data and use -the `@cvm.getter`, `@cvm.putter`, and `@cvm.deleter` wrappers. +the `@svm.getter`, `@svm.putter`, and `@svm.deleter` wrappers. The wrapper's take two arguments, `schemes` which is a list of URI schemes that the function works with (e.g., http, https), and `media_type` which is the type identifier for your data type. A getter function must have exactly two positional arguments, -the first is the `cvm.State`, and the second is a URI. +the first is the `svm.State`, and the second is a URI. Your getter can include required/optional parameters as keyword-only arguments. ```python import urllib.parse import pathlib -import collagen +import sequence -@cvm.getter(schemes=['file'], media_type='application/json') +@svm.getter(schemes=['file'], media_type='application/json') def get_json_file(state: State, uri: str): path = urllib.parse.urlparse(uri).path path = urllib.parse.unquote(path) @@ -78,11 +78,11 @@ def get_json_file(state: State, uri: str): ``` A putter function must have exactly three positional arguments, -the first is the `cvm.State`, the second is the data object, and the third is a URI. +the first is the `svm.State`, the second is the data object, and the third is a URI. Your putter can include required/optional parameters as keyword-only arguments. ```python -@cvm.putter(schemes=['file'], media_type='application/json') +@svm.putter(schemes=['file'], media_type='application/json') def store_json_file(state: State, data, uri: str): path = urllib.parse.urlparse(uri).path path = urllib.parse.unquote(path) @@ -91,10 +91,10 @@ def store_json_file(state: State, data, uri: str): ``` A deleter function must have exactly two positional arguments, -the first is the `cvm.State`, and the second is a URI. +the first is the `svm.State`, and the second is a URI. Your deleter can include required/optional parameters as keyword-only arguments. ```python -@cvm.deleter(schemes=['file'], media_type='application/json') +@svm.deleter(schemes=['file'], media_type='application/json') def delete_json_file(state: State, uri: str, *, missing_ok: bool = False): path = urllib.parse.urlparse(uri).path path = urllib.parse.unquote(path) @@ -110,8 +110,8 @@ Note that you can set `media_type=None` to match any media types. Method docstrings can specify the following sections: Parameters, Inputs, Outputs, and References. Docstrings should follow numpy-style. ```python -@cvm.method("divide") -def my_divide(state: cvm.State, *, reciprocal: bool = False): +@svm.method("divide") +def my_divide(state: svm.State, *, reciprocal: bool = False): """ Divides two numbers [1]. @@ -143,11 +143,11 @@ def my_divide(state: cvm.State, *, reciprocal: bool = False): ``` You can generate documentation for your package using [MkDocs](https://www.mkdocs.org/) with the -[mkdocstrings](https://mkdocstrings.github.io/) plugin. Collagen automatically provides the `collagen` handler for mkdocstrings, which parses method docstrings. Package imports are specified by `options.imports` and procedures are included by `options.includes`. Data methods are included via `options.data` and methods/procedures are included via `options.ops`. +[mkdocstrings](https://mkdocstrings.github.io/) plugin. Sequence automatically provides the `sequence` handler for mkdocstrings, which parses method docstrings. Package imports are specified by `options.imports` and procedures are included by `options.includes`. Data methods are included via `options.data` and methods/procedures are included via `options.ops`. ``` ::: my_toolkit - handler: collagen + handler: sequence options: imports: - my_toolkit diff --git a/docs/assets/16.png b/docs/assets/16.png new file mode 100644 index 0000000000000000000000000000000000000000..eeca255a37ca2422e857d6a311eb14850a5ef0d4 GIT binary patch literal 463 zcmV;=0WkiFP)x9u{Liq9mVTdY~ zNbT%^QY*UE3Sd4y@VZ@8xlF2FCmM|ipPphD#X2yH1!7sGDizQgRjqVi| zK~z|U?UzkU8&MR7pEEOwi56u-Ed)^)#;UbcL%$d5N_5qqkbmHxY5#$^>e7uX!7hu1 zv{qDzwGO1vswI9P#CNMFkU9|6N;M{xOhkMUC+<|{xQZHa$zrIy0mC|Ba zZOs@Mkz&mEvy#dD2n}$$u<%So7BQx~8S~$?XS9CNp2@tu9B^tZ4JU9j!e1L*yIDyyrQLg8W{8pRnHz`l16iN#t2V2+L`FE4{qScwEy zUmw^u=I{{ZdH9=~D9 z>4lsPt&T)!o1VsBTf_hKDL9FIo{D8*_x56sjt1@6GJq}5^v-OJp z`irPGfHCIAo$BPQcLg7Hq43DhW~J$8d9jEt6b!Hy8o+2hC$Q*mY}{$iy(*DCBQjSr zRBw-&pYJF-PFjo!|GcRoZOqTO*6-{6n*G-=PNMz>%8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H11T0BJ zK~!jg?U~(b6iF1ve^oU-llU=-BtZ#eGI2H$vhhYmMBNC2dJ$Om+UO(fK7k0!vM=B( zL?2*TL{Jc!7(|4K5@Hf@NKAs!ILM&Md~{cr7rmKeR_8;zCgN^>SJlkvbI!lJ=bY2k zu)_}jZ$u+TYhz=-NGX5Cm_Y%tW+r5yh!E2fuEj=2|EgzSS3v&y^{c?|R7M>vkv9RH1RUHsRt!S?}tAw+-6=xC;zeWa!{_z92z z&gs*ro*t{oRzoi?;-=F8(!elKRe-GJ$UtY=aL*oV3D#q4EaUrKHEo-oO_SLX@U8jo z1=OrUUyL#6moM>`mhe|sG5LH@4jl&>k0ZOfkiEUg&d&P28pN6algm*WAIIc!pZ@5& z_}MIeHVZQ|$gVCTM~+w#V&xGs>+6*6+^I-j?A?p%=|T1NArBmY$mX^3S63!Otq3sre0eQ9I%*p`4$(7b!1F2|tFOh%e?YXhme=Opy9Q1W zU}-3{B0zR`m)G9R40>)3jIrUmery{~B11!)cflCkM~^7pyovYh8D?$GMu_UMZ8#CT zb`d>$mQp&6dH)^=`hqt(i8nck?C3!D_M#FA#O~cTLYA@C$V7WPv5^tH>1p)r>}FYo zauf3&KSp+U6B!z^){X6s5=s#{e3;1KAbN2TJwK2C>ea^ERZ#nvmnkhTqx$=CjvfUS zt`pc5uz^yjWD=E3Vv0rlg$2C1xr$D$pFhXs^Fc`sLDQ#E5sRS)28fM};G8^(h;43a z_)AOZ`T0=(w{M&l0@c??^xV0M2BtGrUw0eAo`44HzG!PhC6k+{{ZqBRmhb|M!F%$A z(%rj_i`de+5e@CFRVADNV{j)X@TR8lS5|NzK5R&Y|MqQpE#mP|DTJ#+LSS6Ce5hZ% z0AqqFvr2jN-@K`uUPJCRg?@ybQ>PH^?d4;g$xys?3%$4qT5lR^jm~5!-Md%5OClae z_4S2{AG!~SXq4Fb^SBQl1W6N&5pFt-8;O)h2eY;ojL;iIqeO>?L591AcB+u$;0zDr z96MG~=kYvDE*CVgEy;_0`-ok*fM{zA9olLqR)-FuQYrMp0{-$cem09K6hH_>OAE5I z6PZW^&wa@1vw{6lA`%H+9aAamu0O|jzp=F=;9FBufRJ)^W9@(V(EMyRVr`j^w&w6T zYW|6ZQsc(+G@#u3_tD$=i77w}NY~7a;5dsr9W#KG*pZWV`D!X xA$|jX+?LO*FeRkC)^hRU-_4A*!w&xiJ_22OfzXr^rRM+u002ovPDHLkV1mBsF^m8J literal 0 HcmV?d00001 diff --git a/docs/assets/favicon.png b/docs/assets/favicon.png new file mode 100644 index 0000000..e69de29 diff --git a/docs/assets/favicon.svg b/docs/assets/favicon.svg new file mode 100644 index 0000000..c95797d --- /dev/null +++ b/docs/assets/favicon.svg @@ -0,0 +1,66 @@ + + + + + + + + + S + + diff --git a/docs/assets/sequence.png b/docs/assets/sequence.png new file mode 100644 index 0000000000000000000000000000000000000000..ca137aca7eddd785e520f9dba7c494e9eaf73cdc GIT binary patch literal 9231 zcmYj%Wl&sA6D|@Gg1fu>LU8xsE{j`mcUU}FaQ7eyt_#84T|2Ocq0a4|{`JHN;_`kFN6i9&m6N z1OGknBQE8Zuu5W2Sv^lJ7i&)+b9XB^A0HnMJ7))vFXpaR94_uQ-ytF-aBx&`3Nn(~ zzPV?4pd_Oa&{FWrMyDXO8^A_@%0_S}8S+j3BHV~M=ABjc&v&cZ3XM3KH8O6Mg=DIg zxh&6z+Jel$9XgISGT{sb=FbWWct0l#^*=GC{6Myk_WwFGgyj8IG^8uBZDaP~3pDG_ z+WT-Lup!qJ-`;1V+c`kA_9<}PH25Vj6lu@&wM6{%GJude2=@p9p*54ZSR@f^^Uh`E zCeZDsJlPKEDongu_U@HCIsjdUf3#i-Ifv02dnYucrM&tc^>XR_I9vCk>-^Rhy~b)Y zImHD*7@ohy2ctE7?}L@e*^FsWn{bL95~IIAE8D<5W3QVTzk0q4_4O#(Z`5b??1Hz3 zUActtPc;(x0zYNiJAw@r9}>TcO2~FcOwwNW>M#$Eh1k7T+#m2Ca>Lq)ZI7_LIaNe0 zCZCSnp5ZS>ByE<}U-j5<2bHAl$i1B(pP=ll;$R@8BPDU0zLQ+T8>M8{-RtRoJpNgs z%zAI4mZ)1}=K{AW5ha&YUkT@a5R2ui)QcIWqZ9mGQ)4&)hd_0I@LdhX7j>yQAIEwO z;3@mCP`PMIsnink{PcET9{z^fNT?1*p!N?>G9{3Eo04y*f4!@ydSXlMp@#lp=i~S& zEe>6A_;6lgxb-2E<4lw7qzw62S5hecJ8CeCX1DwER^O{J1y3`@O_(HHI_M zxQx}>{Np~a1iSDbcw z{*#7RtBJ5gve3*q5K9aZH<7~c+a}AA&_RtMQCAlg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^;{bnr@Ax^sT-}$~d>Fc2a%m0wm zeWs1}CEtVZo%-2ufNg}ILb=WRrY&;))R3*~dSzJ)yk+g7FL@TaK;GJrnC8SZ%9MK5 zi+p)IyT1g}eRKsL`iqJh#E)E~S1@f#jLU`OJjZ79hxVcuKZ}tkch5jFYh#n;X literal 0 HcmV?d00001 diff --git a/docs/assets/sequence.svg b/docs/assets/sequence.svg new file mode 100644 index 0000000..a9aa723 --- /dev/null +++ b/docs/assets/sequence.svg @@ -0,0 +1,901 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + S + + + + E + + + + Q + + + + U + + + + N + + + + C + + + + E + + + + E + + + + diff --git a/docs/assets/sequence_white_background.png b/docs/assets/sequence_white_background.png new file mode 100644 index 0000000000000000000000000000000000000000..94f0bc19b01fb5965e221874e1c2346a3ff85c79 GIT binary patch literal 7990 zcmZ`;Wl+^$wEYpnB_$=LL_$g$q>=6pxpX(krMZA09n#$hNOzaOl`g4Ew{&;&_`jL= z@qIY8XU@#tv-g>^*4kkzO43;9r04(uV9Clzr~v>1{ADi;LVTI8=6kJP7BnXrT^9hr z?)h&Z^f~@AdohwgBy}L_jusGis?1N1RWq`lrGRJHA?W|9(N6p(fFU~&PcPfX{;2^RFfWCX^ed)j4PYU*XlFeh+=l1ev&fG&g-B0+zxiH(f}qpivpqSK%HT z^>C{Lc&D3Q9GG_WbW1TF;pWzlC5!(h66Dy`@^rd)!6AL&gUCog_{7Oc%7Fihl7b4% zguM&!??(vkyzRB?Kl%739t{N`KqjZ)AvTWwPIh6IX#`; z#%HIB5?Ts$!~h@l^U3PBl&492-8XFddFADz#Te^Wr0HoBeZ6sGpwldh_-gPxCuUwq zh9{+s*J7-$HZ@mp?Fu4YKFvQm(^si9R6r<=5U&b+UQMhRV={Wz$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t@lmURT%NI}l8v=6U4C+CXU8z>?q2_=m&ao>wE zTziy2h1~~>-h!x$4=?%C50+xL3~>|UTE6&kWNBs45-l1XKL_Zoz`u`&qOlZtF>XO*Pco&NGQ83xdx!;hdpwV`}HHfeu(bkrcWSr|A(_`R_+fp+B zQfHt}y7>R;{Z;pO8Lj%-Vij6VP<`6$)#Og-4~t5HNn20mI7^XPHS)c~gEu zu*~~OS7F}H#0nBC)c{m^`A^&Y^-OO+Z~L&~dDggxY!!~lHeKh}g}la9-Pv&}f`nDn zHuFOvQ-eC0$Jt@0Y!ilWEgJDxdbj99%un1Ri8EJ170{wBUQKuKs zWM+5l5Rzn;0@lm_4tZ(vC^Z@&0jr@y3k&%}L%Z%0W|8QKh&d%TE57?}3aIPer`?JQaNl8ia9I;X6LAyV*jxA#sz*RsX@Y$9gy-5P2RV zFaH_~OC3yW++saKKZK@;B(VziI}!Ce`OV&?aFXU|t-tVXo&x|jU*2R}+eW0umWqkn zbqTBC+@iH8vIKE9m@FI2NpgS*%0aWx^7v|HwfgrR6*5Avw)RMb0zV3e)MK_!cezw0 zxwvWMVw*LGzt0UEcJWmJ8;>=Pj8{SGVNN-CvFSKXG_+!=$$8WaHim){zV`u%y8qS? z;+l%p?7RVj;$ncPzvH+pQSmz9@lr%8P>Bv)K3j3D-d*l1{5F{-NkHL$S}%H}Lvq0D zF6ScJt7|*kdg#n>NldD!h`o}NqQ+@2FW{}}ct1j41_ytcjMu9S^J%(Y prhtK_fVFakhC}Yz&I$xPQBGc_={zPezkD$OAS diff --git a/docs/custom_theme/partials/top-nav/top.html b/docs/custom_theme/partials/top-nav/top.html new file mode 100644 index 0000000..2fca66b --- /dev/null +++ b/docs/custom_theme/partials/top-nav/top.html @@ -0,0 +1,14 @@ +{%- set features = config.theme.features or [] -%} +{%- if page and page.meta and page.meta.hide -%} +{%- set hide_top_nav = "true" if "top_nav" in page.meta.hide -%} +{%- endif -%} +{%- if "navigation.top.hide" not in features and not hide_top_nav -%} +
+
+ + {% include "partials/top-nav/menu.html" %} +
+
+{%- endif -%} diff --git a/docs/extra.css b/docs/extra.css index a94577e..b91bd30 100644 --- a/docs/extra.css +++ b/docs/extra.css @@ -3,7 +3,7 @@ h2 { margin-bottom: 0.2em; } -.collagen-op-preview { +.sequence-op-preview { display: inline; } diff --git a/docs/img/favicon.ico b/docs/img/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..68feb4da0b0df08817cf4e953d8f710f7154f9b0 GIT binary patch literal 15086 zcmeI3NpBQK6vrzfij?KRC1EUQ^4| z^5sgdJ?h8TmHJ32)zjlW56b(04w_=%>+~*j7 z`ug#%hEc)=MQbbj)eU%x*0*R^XU z-H6CT-bUpwUoPrx+Z>(AIC^w6ub)4!xK&3ffAL~b@7|r)&z@CuMT(t0ThznD`N-u9 z1+8;Aj~|7mrpkKrW+!raH>3Q_%~kaI^F=K(cdxvUf*;J2lLeQj^of4-sBEf?RQ|z( zvfi@A(Zyo5m@9{<{GU9j=nWfk`tIG5zJI^04<0P&t5?0gje;LO4(}2_pS4zMOl(3ciL%(49!XzF!alhq zhUfD)yyU&;{??NKeK|0YTb)ijU$&F_`?H@ms~3HJ*^m4CbJLP^94Vd7{hLl_nVuq% z@SKpgS5BWUYHVgZ>C~yBrY@;-JQ8!sBzbdt_IP%=c9ggFL|xPwmA}Z#iJL!l{$Kdd z&Q|oXV+D6Ek#<$*;(PZN<|DhOkYyb0XRcu0lfHD5=#}2O)zO243*+SENo#VO2N4H< z=H3GbTs=ac^_eq8jXwbKjk%2XV7q<0*58SPKXWhji;tw4$AgG@75@A7)sCGw_``2{ zy8KexY#cXlmR$ZaAKI^VT>NV)^*zuBhYx%0-?=kc{!gD)s=9&vFI=eA!Nq7lJ{&&J z-o2hqnlZunKo&N|$se6(jNu0wp6DgApPdcX%eeT%duYgU`C@m*#`5~stx|Oy+HJP) z4pMIy$hlcW1zuoX*U3BPB!Cez9 zmi{r$uzz4+9mhChJ%~Ka9KiY}o2?xHakZbe&dijnI%xEtYbKM^_&WCb(8wlE{-#dW zu*|o2?v&g$RjGE$G1=VfV(_nF(BR=!<1hW$Y5#LlY-%k2H$FUdNt>GRzq6l+eVwuO zyUqJ))-+N5U-D%#`khoN_gOn@FUm^WS2w%W z%{j*P3tOz?*M&o9#t5)=f_|f(2C3n5fni*Td z+M0MOu^h&xe;x1drB2EJ%9WD4cWTC7y(_UI*2(oKY5c^m*faIxC3Zo~l4Rl-CJ%81 z;vPYiB>sH9qId1`Vs8c;c$qKk*aP>(!tMCrjvdZR@gmxjB>w&TYvZKsU)Z?)@+Hec! zMxDUVJ}|a02sd$d_NZRG2=*8JZAltG=iWFkXJbd-o55_iA!+>f*#mThvv1AJ2R3%@ zlg5v4Z)DG2RlAfle%r=i;~NouW6o#<R#8#`62ngC;4-KDqR0m Us(THVgOQV7GcPw+u=VBpA05rvd;kCd literal 0 HcmV?d00001 diff --git a/docs/sequence.svg b/docs/sequence.svg new file mode 100644 index 0000000..fa067f2 --- /dev/null +++ b/docs/sequence.svg @@ -0,0 +1,901 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + S + + + + E + + + + Q + + + + U + + + + N + + + + C + + + + E + + + + E + + + + diff --git a/docs/std.md b/docs/std.md index 70ab026..a95ae17 100644 --- a/docs/std.md +++ b/docs/std.md @@ -1,17 +1,17 @@ # Standard Toolkit -The standard toolkit is the collection of methods that are built into Collagen. The standard toolkit provides +The standard toolkit is the collection of methods that are built into Sequence. The standard toolkit provides the methods for scripting logic such as branching (if-else-endif), looping (begin-while-repeat), and working with the stack, and data methods for loading/storing/deleting local variables, global variables, and JSON data. ## Stack Manipulation These methods are used to perform actions on the stack. They include operations such as duplicating items, reordering items, droping items, etc. -::: collagen - handler: collagen +::: sequence + handler: sequence options: imports: - - collagen.standard + - sequence.standard ops: - dup - swap @@ -25,11 +25,11 @@ These methods are used to perform actions on the stack. They include operations These methods are used to compare items on the stack. These are useful as conditional leading before an if or while statement. -::: collagen - handler: collagen +::: sequence + handler: sequence options: imports: - - collagen.standard + - sequence.standard ops: - eq - neq @@ -43,11 +43,11 @@ statement. These methods facilitate looping and recursion. Loops start with `begin` and end with `repeat`. Loops are terminated by `break`. The `while` method is provided for convenience, and effectively guards a `break` in an if-block. -::: collagen - handler: collagen +::: sequence + handler: sequence options: imports: - - collagen.standard + - sequence.standard ops: - begin - while @@ -59,11 +59,11 @@ The `while` method is provided for convenience, and effectively guards a `break` ## Branching These methods facilitate conditional branching. -::: collagen - handler: collagen +::: sequence + handler: sequence options: imports: - - collagen.standard + - sequence.standard ops: - if - else @@ -73,11 +73,11 @@ These methods facilitate conditional branching. ## Conversion These methods are used to coerce the item at the top of the stack to a specific data type. -::: collagen - handler: collagen +::: sequence + handler: sequence options: imports: - - collagen.standard + - sequence.standard ops: - asbool - asint @@ -87,11 +87,11 @@ These methods are used to coerce the item at the top of the stack to a specific ## Arithmetic These methods are used to perform arithmetic. -::: collagen - handler: collagen +::: sequence + handler: sequence options: imports: - - collagen.standard + - sequence.standard ops: - "/" - "*" @@ -103,11 +103,11 @@ These methods are used to perform arithmetic. ## Miscellaneous These methods don't fit into the other categories, but they are useful. -::: collagen - handler: collagen +::: sequence + handler: sequence options: imports: - - collagen.standard + - sequence.standard ops: - fstring - assert @@ -123,11 +123,11 @@ JSON data. ## Variables These methods are used to store, load, and delete local and global variables. Local variables are procedure-scoped. -::: collagen - handler: collagen +::: sequence + handler: sequence options: imports: - - collagen.standard + - sequence.standard data: - locals - globals @@ -135,11 +135,11 @@ These methods are used to store, load, and delete local and global variables. Lo ## JSON These methods are used to store, load, and delete JSON files. -::: collagen - handler: collagen +::: sequence + handler: sequence options: imports: - - collagen.standard + - sequence.standard data: - http:application/json - https:application/json @@ -147,14 +147,14 @@ These methods are used to store, load, and delete JSON files. ### JSON5 -JSON5 is an extension of JSON that adds functionality such as comments, multiline strings, trailing commas, and unquoted strings. You can read more about JSON5 [here](https://json5.org/). These methods require that Collagen was installed with -JSON5 support (i.e., `pip install 'collagen[json5]'`). +JSON5 is an extension of JSON that adds functionality such as comments, multiline strings, trailing commas, and unquoted strings. You can read more about JSON5 [here](https://json5.org/). These methods require that Sequence was installed with +JSON5 support (i.e., `pip install 'sequence[json5]'`). -::: collagen - handler: collagen +::: sequence + handler: sequence options: imports: - - collagen.standard + - sequence.standard data: - http:application/json5 - https:application/json5 @@ -162,12 +162,12 @@ JSON5 support (i.e., `pip install 'collagen[json5]'`). ### HJSON HJSON is an extension of JSON that is less prone to syntax errors and adds functionality such as comments, multiline strings, trailing commas, and unquoted strings. You can read more about HJSON [here](https://hjson.github.io/). -These methods require that Collagen was installed with HJSON support (i.e., `pip install 'collagen[hjson]'`). -::: collagen - handler: collagen +These methods require that Sequence was installed with HJSON support (i.e., `pip install 'sequence[hjson]'`). +::: sequence + handler: sequence options: imports: - - collagen.standard + - sequence.standard data: - http:application/hjson - https:application/hjson diff --git a/mkdocs.yml b/mkdocs.yml index bc682b4..44c4f3c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,7 +1,8 @@ -site_name: Collagen -site_url: https://collagen.dev +site_name: Sequence +site_url: https://sequence.dev theme: name: terminal + logo: docs/img/sequence.png custom_dir: docs/custom_theme/ plugins: - mkdocstrings diff --git a/mkdocstrings_handlers/collagen/__init__.py b/mkdocstrings_handlers/sequence/__init__.py similarity index 100% rename from mkdocstrings_handlers/collagen/__init__.py rename to mkdocstrings_handlers/sequence/__init__.py diff --git a/mkdocstrings_handlers/collagen/handler.py b/mkdocstrings_handlers/sequence/handler.py similarity index 95% rename from mkdocstrings_handlers/collagen/handler.py rename to mkdocstrings_handlers/sequence/handler.py index 0a8f9d7..98d0fb6 100644 --- a/mkdocstrings_handlers/collagen/handler.py +++ b/mkdocstrings_handlers/sequence/handler.py @@ -5,7 +5,7 @@ import urllib.parse import importlib -import collagen.vm +import sequence.vm import re @@ -89,7 +89,7 @@ def _docstring_reference(): return metadata -class CollagenHandler(BaseHandler): +class SequenceHandler(BaseHandler): def __init__(self, *args, **kwargs) -> None: self.fallback_theme = 'terminal' super().__init__(*args, **kwargs) @@ -100,7 +100,7 @@ def collect(self, identifier: str, config: MutableMapping[str, Any]) -> Collecto for module in imports: importlib.import_module(module) - vm = collagen.vm.VirtualMachine() + vm = sequence.vm.VirtualMachine() for routine, url in includes.items(): vm._include(routine, url) @@ -109,7 +109,7 @@ def collect(self, identifier: str, config: MutableMapping[str, Any]) -> Collecto 'op_metadata': [] } for op_name in config.get('ops', []): - op = collagen.vm._static_ops[op_name] + op = sequence.vm._static_ops[op_name] if callable(op): docstring = inspect.getdoc(op) metadata = parse_docstring(docstring) @@ -130,9 +130,9 @@ def collect(self, identifier: str, config: MutableMapping[str, Any]) -> Collecto scheme = data_spec media_type = None - getter = collagen.vm._static_getters.get(scheme, {}).get(media_type, None) - putter = collagen.vm._static_putters.get(scheme, {}).get(media_type, None) - deleter = collagen.vm._static_deleters.get(scheme, {}).get(media_type, None) + getter = sequence.vm._static_getters.get(scheme, {}).get(media_type, None) + putter = sequence.vm._static_putters.get(scheme, {}).get(media_type, None) + deleter = sequence.vm._static_deleters.get(scheme, {}).get(media_type, None) if getter is not None: docs['extdata_op'].append("get") @@ -203,7 +203,7 @@ def render(self, data: CollectorItem, config: Mapping[str, Any]) -> str: def get_handler( **kwargs, ): - return CollagenHandler( - handler="collagen", + return SequenceHandler( + handler="sequence", **kwargs ) diff --git a/mkdocstrings_handlers/collagen/templates/terminal/metadata.html b/mkdocstrings_handlers/sequence/templates/terminal/metadata.html similarity index 100% rename from mkdocstrings_handlers/collagen/templates/terminal/metadata.html rename to mkdocstrings_handlers/sequence/templates/terminal/metadata.html diff --git a/mkdocstrings_handlers/collagen/templates/terminal/ops.html b/mkdocstrings_handlers/sequence/templates/terminal/ops.html similarity index 84% rename from mkdocstrings_handlers/collagen/templates/terminal/ops.html rename to mkdocstrings_handlers/sequence/templates/terminal/ops.html index 03df4c1..0200e10 100644 --- a/mkdocstrings_handlers/collagen/templates/terminal/ops.html +++ b/mkdocstrings_handlers/sequence/templates/terminal/ops.html @@ -1,6 +1,6 @@ {%- for op, metadata in op_names|zip(op_metadata) -%}
- { "op": "{{ op }}"{{ ', ...' if metadata.parameters|length != 0}} } + { "op": "{{ op }}"{{ ', ...' if metadata.parameters|length != 0}} }
{% include 'metadata.html' %}
@@ -9,7 +9,7 @@ {%- for op, metadata, scheme, media_type in extdata_op|zip(extdata_metadata,extdata_scheme,extdata_media_type) -%}
- { "op": "{{ op }}", + { "op": "{{ op }}", {{'"media_type": "' + media_type + '",' if media_type}} "uri": "{{ scheme }}://..." {{ ', ...' if metadata.parameters|length > 1}} diff --git a/collagen/__init__.py b/sequence/__init__.py similarity index 100% rename from collagen/__init__.py rename to sequence/__init__.py diff --git a/collagen/_version.py b/sequence/_version.py similarity index 99% rename from collagen/_version.py rename to sequence/_version.py index 6644b44..ebb46ff 100644 --- a/collagen/_version.py +++ b/sequence/_version.py @@ -53,7 +53,7 @@ def get_config() -> VersioneerConfig: cfg.style = "pep440" cfg.tag_prefix = "" cfg.parentdir_prefix = "None" - cfg.versionfile_source = "collagen/_version.py" + cfg.versionfile_source = "sequence/_version.py" cfg.verbose = False return cfg diff --git a/collagen/cli.py b/sequence/cli.py similarity index 58% rename from collagen/cli.py rename to sequence/cli.py index 5061e94..a83e136 100644 --- a/collagen/cli.py +++ b/sequence/cli.py @@ -1,8 +1,8 @@ import argparse import json -import collagen +import sequence if __name__ == '__main__': - vm = collagen.VirtualMachine() + vm = sequence.VirtualMachine() vm.repl() diff --git a/sequence/standard/__init__.py b/sequence/standard/__init__.py new file mode 100644 index 0000000..47a8883 --- /dev/null +++ b/sequence/standard/__init__.py @@ -0,0 +1,7 @@ +import sequence.standard.branching +import sequence.standard.loops +import sequence.standard.operators +import sequence.standard.other +import sequence.standard.stack_operations +import sequence.standard.types +import sequence.standard.resources diff --git a/collagen/standard/branching.py b/sequence/standard/branching.py similarity index 91% rename from collagen/standard/branching.py rename to sequence/standard/branching.py index cce4861..2a8e860 100644 --- a/collagen/standard/branching.py +++ b/sequence/standard/branching.py @@ -1,8 +1,8 @@ -import collagen.vm as cvm +import sequence.vm as svm -@cvm.method("if") -def if_(state: cvm.State): +@svm.method("if") +def if_(state: svm.State): """ Marks the beginning of an if-block. An if statment MUST be terminated by `{"op": "endif"}`. @@ -37,8 +37,8 @@ def if_(state: cvm.State): raise RuntimeError("Unterminated if statement") -@cvm.method("else") -def else_(state: cvm.State): +@svm.method("else") +def else_(state: svm.State): """ Marks the beginning of an else-block. This method MUST be placed between `{"op": "if"}` and `{"op": "endif"}`. @@ -67,8 +67,8 @@ def else_(state: cvm.State): raise RuntimeError("Unterminated if statement") -@cvm.method("endif") -def endif_(state: cvm.State): +@svm.method("endif") +def endif_(state: svm.State): """ Marks the end of an if statement. """ diff --git a/collagen/standard/loops.py b/sequence/standard/loops.py similarity index 84% rename from collagen/standard/loops.py rename to sequence/standard/loops.py index 9881544..5cf3638 100644 --- a/collagen/standard/loops.py +++ b/sequence/standard/loops.py @@ -1,25 +1,25 @@ -import collagen.vm as cvm +import sequence.vm as svm # looping -@cvm.method("begin") -def begin_(state: cvm.State): +@svm.method("begin") +def begin_(state: svm.State): """ Marks the beginning of a loop. """ state._op_frame._begins.append(state._op_frame._pc) -@cvm.method("repeat") -def repeat_(state: cvm.State): +@svm.method("repeat") +def repeat_(state: svm.State): """ Marks the end of a loop. """ state._op_frame._pc = state._op_frame._begins[-1] -@cvm.method("break") -def break_(state: cvm.State): +@svm.method("break") +def break_(state: svm.State): """ Breaks out of a loop (terminates the loop). """ @@ -47,16 +47,16 @@ def break_(state: cvm.State): raise RuntimeError("Unterminated begin statement") -@cvm.method("recurse") -def recurse(state: cvm.State): +@svm.method("recurse") +def recurse(state: svm.State): """ Restarts the current procedure. """ state._op_frame._pc = -1 -@cvm.method("while") -def while_(state: cvm.State): +@svm.method("while") +def while_(state: svm.State): """ Continues the loop if the item at the top of the stack is true. If the item at the top of the stack is not true, it terminates the loop. diff --git a/collagen/standard/operators.py b/sequence/standard/operators.py similarity index 87% rename from collagen/standard/operators.py rename to sequence/standard/operators.py index 90615fe..66b6f2b 100644 --- a/collagen/standard/operators.py +++ b/sequence/standard/operators.py @@ -1,9 +1,9 @@ -import collagen.vm as cvm +import sequence.vm as svm # comparison -@cvm.method("eq") -def equal(state: cvm.State): +@svm.method("eq") +def equal(state: svm.State): """ Checks if x == y. @@ -23,8 +23,8 @@ def equal(state: cvm.State): return x == y -@cvm.method("neq") -def not_equal(state: cvm.State): +@svm.method("neq") +def not_equal(state: svm.State): """ Checks if x is not equal to y. @@ -44,8 +44,8 @@ def not_equal(state: cvm.State): return x != y -@cvm.method("gt") -def greater_than(state: cvm.State): +@svm.method("gt") +def greater_than(state: svm.State): """ Checks if x is greater than y. @@ -65,8 +65,8 @@ def greater_than(state: cvm.State): return x > y -@cvm.method("ge") -def greater_than_or_equal_to(state: cvm.State): +@svm.method("ge") +def greater_than_or_equal_to(state: svm.State): """ Checks if x is greater than or equal to y. @@ -86,8 +86,8 @@ def greater_than_or_equal_to(state: cvm.State): return x >= y -@cvm.method("lt") -def less_than(state: cvm.State): +@svm.method("lt") +def less_than(state: svm.State): """ Checks if x is less than y. @@ -107,8 +107,8 @@ def less_than(state: cvm.State): return x < y -@cvm.method("le") -def less_than_or_equal_to(state: cvm.State): +@svm.method("le") +def less_than_or_equal_to(state: svm.State): """ Checks if x is less than or equal to y. @@ -128,8 +128,8 @@ def less_than_or_equal_to(state: cvm.State): return x <= y -@cvm.method("/") -def divide(state: cvm.State): +@svm.method("/") +def divide(state: svm.State): """ Divides the two numbers at the top of the stack. If the items at the top of the stack are not numbers, the binary operator '/' is applied to the @@ -151,8 +151,8 @@ def divide(state: cvm.State): return x / y -@cvm.method("*") -def multiply(state: cvm.State): +@svm.method("*") +def multiply(state: svm.State): """ Multiplies the two numbers at the top of the stack. If the items at the top of the stack are not numbers, the binary operator '*' is applied to the @@ -174,8 +174,8 @@ def multiply(state: cvm.State): return x * y -@cvm.method("-") -def minus(state: cvm.State): +@svm.method("-") +def minus(state: svm.State): """ Subtracts the two numbers at the top of the stack. If the items at the top of the stack are not numbers, the binary operator '-' is applied to the @@ -197,8 +197,8 @@ def minus(state: cvm.State): return x - y -@cvm.method("+") -def plus(state: cvm.State): +@svm.method("+") +def plus(state: svm.State): """ Adds the two numbers at the top of the stack. If the items at the top of the stack are not numbers, the binary operator '+' is applied to the @@ -220,8 +220,8 @@ def plus(state: cvm.State): return x + y -@cvm.method("%") -def mod(state: cvm.State): +@svm.method("%") +def mod(state: svm.State): """ Returns the modulous the two numbers at the top of the stack. If the items at the top of the stack are not numbers, the binary operator '%' is applied to the @@ -243,8 +243,8 @@ def mod(state: cvm.State): return x % y -@cvm.method("not") -def not_(state: cvm.State): +@svm.method("not") +def not_(state: svm.State): """ Inverts the True/False value at the top of the stack. If the item at the top of the stack is not a boolean value, it is coerced to a boolean and @@ -264,8 +264,8 @@ def not_(state: cvm.State): return not x -@cvm.method("and") -def and_(state: cvm.State): +@svm.method("and") +def and_(state: svm.State): """ Logical AND of the two boolean values at the top of the stack. If the items at the top of the stack are not booleans, they are coerced to @@ -287,8 +287,8 @@ def and_(state: cvm.State): return x and y -@cvm.method("or") -def or_(state: cvm.State): +@svm.method("or") +def or_(state: svm.State): """ Logical OR of the two boolean values at the top of the stack. If the items at the top of the stack are not booleans, they are coerced to @@ -310,8 +310,8 @@ def or_(state: cvm.State): return x or y -@cvm.method("xor") -def xor_(state: cvm.State): +@svm.method("xor") +def xor_(state: svm.State): """ Logical XOR of the two boolean values at the top of the stack. If the items at the top of the stack are not booleans, they are coerced to diff --git a/collagen/standard/other.py b/sequence/standard/other.py similarity index 87% rename from collagen/standard/other.py rename to sequence/standard/other.py index a9b99bd..ac10be2 100644 --- a/collagen/standard/other.py +++ b/sequence/standard/other.py @@ -1,10 +1,10 @@ import string -import collagen.vm as cvm +import sequence.vm as svm # misc -@cvm.method("fstring") -def format_string(state: cvm.State, *, fmt: str, **params): +@svm.method("fstring") +def format_string(state: svm.State, *, fmt: str, **params): """ Formats a string. @@ -43,8 +43,8 @@ def format_string(state: cvm.State, *, fmt: str, **params): return fmt.format(*args, **params) -@cvm.method("assert") -def assert_(state: cvm.State, *, error: str = '', negate: bool = False): +@svm.method("assert") +def assert_(state: svm.State, *, error: str = '', negate: bool = False): """ Asserts that the item at the top of the stack is true. Terminates execution if false. @@ -69,8 +69,8 @@ def assert_(state: cvm.State, *, error: str = '', negate: bool = False): assert x, error -@cvm.method("set_next_params") -def set_next_params(state: cvm.State): +@svm.method("set_next_params") +def set_next_params(state: svm.State): """ Initializes the next op's parameters to the key-value array at the top-of-the-stack. diff --git a/sequence/standard/resources/__init__.py b/sequence/standard/resources/__init__.py new file mode 100644 index 0000000..ccefd9e --- /dev/null +++ b/sequence/standard/resources/__init__.py @@ -0,0 +1,7 @@ +import sequence.standard.resources.methods +import sequence.standard.resources.file +import sequence.standard.resources.hson +import sequence.standard.resources.json +import sequence.standard.resources.json5 +import sequence.standard.resources.hson +import sequence.standard.resources.variable diff --git a/collagen/standard/resources/file.py b/sequence/standard/resources/file.py similarity index 66% rename from collagen/standard/resources/file.py rename to sequence/standard/resources/file.py index b1ea850..ca17c0b 100644 --- a/collagen/standard/resources/file.py +++ b/sequence/standard/resources/file.py @@ -1,11 +1,11 @@ import urllib.parse import urllib.request import pathlib -import collagen.vm as cvm +import sequence.vm as svm -@cvm.deleter(schemes=['file']) -def delete_generic_file(state: cvm.State, uri: str, *, missing_ok: bool = False): +@svm.deleter(schemes=['file']) +def delete_generic_file(state: svm.State, uri: str, *, missing_ok: bool = False): """ Deletes a local file. """ diff --git a/collagen/standard/resources/hson.py b/sequence/standard/resources/hson.py similarity index 78% rename from collagen/standard/resources/hson.py rename to sequence/standard/resources/hson.py index 7ddbd50..814e617 100644 --- a/collagen/standard/resources/hson.py +++ b/sequence/standard/resources/hson.py @@ -1,6 +1,6 @@ import urllib.parse import urllib.request -import collagen.vm as cvm +import sequence.vm as svm try: @@ -10,8 +10,8 @@ ENABLE_HJSON = False -@cvm.getter(schemes=['http', 'https'], media_type='application/hjson') -def fetch_hjson_http(state: cvm.State, url: str): +@svm.getter(schemes=['http', 'https'], media_type='application/hjson') +def fetch_hjson_http(state: svm.State, url: str): """ Loads a HJSON file from a remote HTTP/HTTPS source. @@ -28,8 +28,8 @@ def fetch_hjson_http(state: cvm.State, url: str): return hjson.loads(response.read()) -@cvm.getter(schemes=['file'], media_type='application/hjson') -def fetch_hjson_file(state: cvm.State, url: str): +@svm.getter(schemes=['file'], media_type='application/hjson') +def fetch_hjson_file(state: svm.State, url: str): """ Loads a HJSON file from a local file. @@ -47,8 +47,8 @@ def fetch_hjson_file(state: cvm.State, url: str): return data -@cvm.putter(schemes=['file'], media_type='application/hjson') -def store_hjson_file(state: cvm.State, data, uri: str): +@svm.putter(schemes=['file'], media_type='application/hjson') +def store_hjson_file(state: svm.State, data, uri: str): """ Loads a HJSON file from a local file. diff --git a/collagen/standard/resources/json.py b/sequence/standard/resources/json.py similarity index 73% rename from collagen/standard/resources/json.py rename to sequence/standard/resources/json.py index 400654f..1cfe5ee 100644 --- a/collagen/standard/resources/json.py +++ b/sequence/standard/resources/json.py @@ -1,10 +1,10 @@ import json import urllib.parse import urllib.request -import collagen.vm as cvm +import sequence.vm as svm -@cvm.getter(schemes=['http', 'https'], media_type='application/json') -def fetch_json_http(state: cvm.State, url: str): +@svm.getter(schemes=['http', 'https'], media_type='application/json') +def fetch_json_http(state: svm.State, url: str): """ Loads a JSON file from a remote HTTP/HTTPS source. @@ -19,8 +19,8 @@ def fetch_json_http(state: cvm.State, url: str): return json.loads(response.read()) -@cvm.getter(schemes=['file'], media_type='application/json') -def fetch_json_file(state: cvm.State, url: str): +@svm.getter(schemes=['file'], media_type='application/json') +def fetch_json_file(state: svm.State, url: str): """ Loads a JSON file from a local file. @@ -36,8 +36,8 @@ def fetch_json_file(state: cvm.State, url: str): return data -@cvm.putter(schemes=['file'], media_type='application/json') -def store_json_file(state: cvm.State, data, uri: str): +@svm.putter(schemes=['file'], media_type='application/json') +def store_json_file(state: svm.State, data, uri: str): """ Loads a JSON file from a local file. diff --git a/collagen/standard/resources/json5.py b/sequence/standard/resources/json5.py similarity index 78% rename from collagen/standard/resources/json5.py rename to sequence/standard/resources/json5.py index 6f8142d..fb5da4e 100644 --- a/collagen/standard/resources/json5.py +++ b/sequence/standard/resources/json5.py @@ -1,6 +1,6 @@ import urllib.parse import urllib.request -import collagen.vm as cvm +import sequence.vm as svm try: @@ -10,8 +10,8 @@ ENABLE_JSON5 = False -@cvm.getter(schemes=['http', 'https'], media_type='application/json5') -def fetch_json5_http(state: cvm.State, url: str): +@svm.getter(schemes=['http', 'https'], media_type='application/json5') +def fetch_json5_http(state: svm.State, url: str): """ Loads a JSON5 file from a remote HTTP/HTTPS source. @@ -28,8 +28,8 @@ def fetch_json5_http(state: cvm.State, url: str): return json5.loads(response.read()) -@cvm.getter(schemes=['file'], media_type='application/json5') -def fetch_json5_file(state: cvm.State, url: str): +@svm.getter(schemes=['file'], media_type='application/json5') +def fetch_json5_file(state: svm.State, url: str): """ Loads a JSON5 file from a local file. @@ -47,8 +47,8 @@ def fetch_json5_file(state: cvm.State, url: str): return data -@cvm.putter(schemes=['file'], media_type='application/json5') -def store_json5_file(state: cvm.State, data, uri: str): +@svm.putter(schemes=['file'], media_type='application/json5') +def store_json5_file(state: svm.State, data, uri: str): """ Loads a JSON5 file from a local file. diff --git a/collagen/standard/resources/methods.py b/sequence/standard/resources/methods.py similarity index 86% rename from collagen/standard/resources/methods.py rename to sequence/standard/resources/methods.py index f305894..5a852d4 100644 --- a/collagen/standard/resources/methods.py +++ b/sequence/standard/resources/methods.py @@ -1,12 +1,12 @@ from typing import Any, Callable import urllib.parse -import collagen.vm as cvm +import sequence.vm as svm from ...vm import _static_getters, _static_deleters, _static_putters # state -@cvm.method("get") -def load(state: cvm.State, *, uri: str, mediaType: str = None, **params): +@svm.method("get") +def load(state: svm.State, *, uri: str, mediaType: str = None, **params): """ Loads an resource from a URI and places it as the top of the stack. @@ -30,8 +30,8 @@ def load(state: cvm.State, *, uri: str, mediaType: str = None, **params): return uri_media_getter(state, uri, **params) -@cvm.method("put") -def store(state: cvm.State, *, uri: str, mediaType: str = None, **params): +@svm.method("put") +def store(state: svm.State, *, uri: str, mediaType: str = None, **params): """ Stores the item at the top of the stack. @@ -56,8 +56,8 @@ def store(state: cvm.State, *, uri: str, mediaType: str = None, **params): uri_media_putter(state, data, uri, **params) -@cvm.method("del") -def delete(state: cvm.State, *, uri: str, mediaType: str = None, **params): +@svm.method("del") +def delete(state: svm.State, *, uri: str, mediaType: str = None, **params): """ Deletes a resource. diff --git a/collagen/standard/resources/variable.py b/sequence/standard/resources/variable.py similarity index 74% rename from collagen/standard/resources/variable.py rename to sequence/standard/resources/variable.py index 9a6f825..6e0f69b 100644 --- a/collagen/standard/resources/variable.py +++ b/sequence/standard/resources/variable.py @@ -1,11 +1,11 @@ from typing import Any import urllib.parse import urllib.request -import collagen.vm as cvm +import sequence.vm as svm -@cvm.getter(schemes='locals', media_type=None) -def load_local_variable(state: cvm.State, key, *, default: Any = None): +@svm.getter(schemes='locals', media_type=None) +def load_local_variable(state: svm.State, key, *, default: Any = None): """ Loads a local variable and places the result at the top of the stack. @@ -23,8 +23,8 @@ def load_local_variable(state: cvm.State, key, *, default: Any = None): return state._op_frame._set.get(path, default) -@cvm.putter(schemes='locals', media_type=None) -def store_local_variable(state: cvm.State, data, key): +@svm.putter(schemes='locals', media_type=None) +def store_local_variable(state: svm.State, data, key): """ Saves a local variable (procedure-scope). """ @@ -32,8 +32,8 @@ def store_local_variable(state: cvm.State, data, key): state._op_frame._set[path] = data -@cvm.deleter(schemes='locals') -def delete_local_variable(state: cvm.State, key): +@svm.deleter(schemes='locals') +def delete_local_variable(state: svm.State, key): """ Deletes a local variable. """ @@ -41,8 +41,8 @@ def delete_local_variable(state: cvm.State, key): del state._op_frame._set[path] -@cvm.getter(schemes='globals', media_type=None) -def load_global_variable(state: cvm.State, key, *, default: Any = None): +@svm.getter(schemes='globals', media_type=None) +def load_global_variable(state: svm.State, key, *, default: Any = None): """ Loads a global variable and places the result at the top of the stack. @@ -60,8 +60,8 @@ def load_global_variable(state: cvm.State, key, *, default: Any = None): return state._vm._globals.get(path, default) -@cvm.putter(schemes='globals', media_type=None) -def store_global_variable(state: cvm.State, data, key): +@svm.putter(schemes='globals', media_type=None) +def store_global_variable(state: svm.State, data, key): """ Saves a global variable. """ @@ -69,8 +69,8 @@ def store_global_variable(state: cvm.State, data, key): state._vm._globals[path] = data -@cvm.deleter(schemes='globals') -def delete_global_variable(state: cvm.State, key): +@svm.deleter(schemes='globals') +def delete_global_variable(state: svm.State, key): """ Deletes a global variable. """ diff --git a/collagen/standard/stack_operations.py b/sequence/standard/stack_operations.py similarity index 86% rename from collagen/standard/stack_operations.py rename to sequence/standard/stack_operations.py index 555a949..deb4a6d 100644 --- a/collagen/standard/stack_operations.py +++ b/sequence/standard/stack_operations.py @@ -1,12 +1,12 @@ from typing import List import copy -import collagen.vm as cvm +import sequence.vm as svm from ..vm import _static_copiers # stack ops -@cvm.method("dup") -def duplicate(state: cvm.State, *, deep: bool = False, offset: int = 0): +@svm.method("dup") +def duplicate(state: svm.State, *, deep: bool = False, offset: int = 0): """ Duplicates the item at the top of the stack. There are parameters to control if a shallow or deep copy is done, as well as control @@ -37,8 +37,8 @@ def duplicate(state: cvm.State, *, deep: bool = False, offset: int = 0): return copy.copy(item) -@cvm.method("swap") -def swap(state: cvm.State, *, order: list = [1, 0]): +@svm.method("swap") +def swap(state: svm.State, *, order: list = [1, 0]): """ Swaps the order of the items at the top of the stack. @@ -55,16 +55,16 @@ def swap(state: cvm.State, *, order: list = [1, 0]): return new_items -@cvm.method("drop") -def drop(state: cvm.State): +@svm.method("drop") +def drop(state: svm.State): """ Drops the item at the top of the stack. """ state.pop() -@cvm.method("size") -def stack_size(state: cvm.State): +@svm.method("size") +def stack_size(state: svm.State): """ Returns the current size (depth) of the stack. @@ -76,8 +76,8 @@ def stack_size(state: cvm.State): return len(state._stack) -@cvm.method("pack") -def pack_(state: cvm.State, *, n: int, forward: bool = True, keys: List[str] = None): +@svm.method("pack") +def pack_(state: svm.State, *, n: int, forward: bool = True, keys: List[str] = None): """ Packs N items from the top of the stack into a single array at the top of the stack. @@ -112,8 +112,8 @@ def pack_(state: cvm.State, *, n: int, forward: bool = True, keys: List[str] = N return items -@cvm.method("unpack") -def unpack_(state: cvm.State, *, keys: List[str] = None): +@svm.method("unpack") +def unpack_(state: svm.State, *, keys: List[str] = None): """ Packs N items from the top of the stack into a single array at the top of the stack. diff --git a/collagen/standard/types.py b/sequence/standard/types.py similarity index 81% rename from collagen/standard/types.py rename to sequence/standard/types.py index d45830a..28b7f6d 100644 --- a/collagen/standard/types.py +++ b/sequence/standard/types.py @@ -1,8 +1,8 @@ -import collagen.vm as cvm +import sequence.vm as svm -@cvm.method("asbool") -def asbool_(state: cvm.State): +@svm.method("asbool") +def asbool_(state: svm.State): """ Coerces the item at the top of the stack to a boolean value. @@ -20,8 +20,8 @@ def asbool_(state: cvm.State): return bool(x) -@cvm.method("asint") -def asint_(state: cvm.State): +@svm.method("asint") +def asint_(state: svm.State): """ Coerces the item at the top of the stack to an integer. @@ -39,8 +39,8 @@ def asint_(state: cvm.State): return int(x) -@cvm.method("asfloat") -def asfloat_(state: cvm.State): +@svm.method("asfloat") +def asfloat_(state: svm.State): """ Coerces the item at the top of the stack to a float. diff --git a/collagen/vm.py b/sequence/vm.py similarity index 98% rename from collagen/vm.py rename to sequence/vm.py index f4fe913..ed0c9ef 100644 --- a/collagen/vm.py +++ b/sequence/vm.py @@ -198,7 +198,7 @@ def run(self, vm: 'VirtualMachine', _run: List[Union[str, dict]]): class VirtualMachine: def __init__(self, init_stack: list = None) -> None: - import collagen.standard + import sequence.standard self._root_frame: OpFrame = OpFrame({}, "root", None) self._started_at = datetime.datetime.utcnow() self._stack = init_stack if init_stack is not None else [] @@ -308,7 +308,7 @@ def method(name): def inner(func: Callable): global _static_ops if func.__code__.co_argcount != 1: - raise RuntimeError("function must take exactly one position argument (state: cvm.State)") + raise RuntimeError("function must take exactly one position argument (state: svm.State)") _static_ops[name] = func return func return inner @@ -322,7 +322,7 @@ def getter(*, schemes: Union[str, list[str]], media_type: str): def inner(func: Callable): global _static_getters if func.__code__.co_argcount != 2: - raise RuntimeError("function must take exactly two position arguments (state: cvm.State, url: str)") + raise RuntimeError("function must take exactly two position arguments (state: svm.State, url: str)") for scheme in schemes: if scheme not in _static_getters: _static_getters[scheme] = {} @@ -339,7 +339,7 @@ def putter(*, schemes: Union[str, list[str]], media_type: str): def inner(func: Callable): global _static_putters if func.__code__.co_argcount != 3: - raise RuntimeError("function must take exactly three position argument (state: cvm.State, data: Any, url: str)") + raise RuntimeError("function must take exactly three position argument (state: svm.State, data: Any, url: str)") for scheme in schemes: if scheme not in _static_putters: _static_putters[scheme] = {} @@ -356,7 +356,7 @@ def deleter(*, schemes: Union[str, list[str]], media_type: str = None): def inner(func: Callable): global _static_deleters if func.__code__.co_argcount != 2: - raise RuntimeError("function must take exactly two position argument (state: cvm.State, url: str)") + raise RuntimeError("function must take exactly two position argument (state: svm.State, url: str)") for scheme in schemes: if scheme not in _static_deleters: _static_deleters[scheme] = {} diff --git a/setup.cfg b/setup.cfg index d0e8674..c9d3523 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,7 @@ [metadata] -name = collagen +name = seq description = A virtual stack machine that executes Python code based on instructions provided in a JSON file. -url = https://github.com/LiamBindle/collagen.git +url = https://github.com/LiamBindle/sequence.git license = install_requires = @@ -10,10 +10,10 @@ install_requires = [options] packages = - collagen - collagen.standard - collagen.standard.resources - mkdocstrings_handlers.collagen + sequence + sequence.standard + sequence.standard.resources + mkdocstrings_handlers.sequence include_package_data = True [options.extras_require] @@ -32,10 +32,10 @@ hjson = [options.entry_points] console_scripts = - collagen = collagen.cli:main + sequence = sequence.cli:main [options.package_data] -mkdocstrings_handlers.collagen = +mkdocstrings_handlers.sequence = templates/terminal/*.html [flake8] @@ -48,5 +48,5 @@ max-line-length = 127 [versioneer] VCS = git style = pep440 -versionfile_source = collagen/_version.py -versionfile_build = collagen/_version.py +versionfile_source = sequence/_version.py +versionfile_build = sequence/_version.py diff --git a/tests/imports.py b/tests/imports.py index 97c823b..3528eaa 100644 --- a/tests/imports.py +++ b/tests/imports.py @@ -1,15 +1,15 @@ -import collagen.vm as cvm +import sequence.vm as svm -@cvm.method("discard_if_neq") -def discard_if_neq(state: cvm.State, *, value): +@svm.method("discard_if_neq") +def discard_if_neq(state: svm.State, *, value): a = state.pop() if a == value: return value -@cvm.method("is_decreasing") -def is_decreasing(state: cvm.State, *, argc: int): +@svm.method("is_decreasing") +def is_decreasing(state: svm.State, *, argc: int): args = state.popn(argc) if len(args) == 0: return False @@ -21,41 +21,41 @@ def is_decreasing(state: cvm.State, *, argc: int): return all(lt) -@cvm.method("pass_through") -def pass_through(state: cvm.State, *, argc: int): +@svm.method("pass_through") +def pass_through(state: svm.State, *, argc: int): args = state.popn(argc) return list(args) -@cvm.method("check_local") -def check_local(state: cvm.State, *, key, value): +@svm.method("check_local") +def check_local(state: svm.State, *, key, value): if state.has(key) and state.get(key) == value: return 1 else: return 0 -@cvm.method("equals") -def equals_(state: cvm.State): +@svm.method("equals") +def equals_(state: svm.State): x, y = state.popn(2) return [x, x == y] -@cvm.method("append_value_to_key") -def append_value_to_key(state: cvm.State, *, key, value: int): +@svm.method("append_value_to_key") +def append_value_to_key(state: svm.State, *, key, value: int): d = state.pop() d[key].append(value) return d -@cvm.method("change_key_value") -def change_key_value(state: cvm.State, *, key, value): +@svm.method("change_key_value") +def change_key_value(state: svm.State, *, key, value): d = state.pop() d[key] = value return d -@cvm.method("check_file_exists") -def check_file_exists(state: cvm.State, *, path): +@svm.method("check_file_exists") +def check_file_exists(state: svm.State, *, path): import os.path return os.path.exists(path) diff --git a/tests/json/test-recurse.json b/tests/json/test-recurse.json index 03c154f..d7ab803 100644 --- a/tests/json/test-recurse.json +++ b/tests/json/test-recurse.json @@ -23,7 +23,7 @@ } ], "references": [ - {"url": "https://github.com/LiamBindle/collagen", "text": "VirtualMachine, GitHub."}, + {"url": "https://github.com/LiamBindle/sequence", "text": "VirtualMachine, GitHub."}, "Second reference" ] }, diff --git a/tests/test_zvm.py b/tests/test_svm.py similarity index 91% rename from tests/test_zvm.py rename to tests/test_svm.py index d09067c..1fdd37b 100644 --- a/tests/test_zvm.py +++ b/tests/test_svm.py @@ -1,5 +1,5 @@ import pytest -import collagen.vm as cvm +import sequence.vm as svm import json TEST_FILES = [ @@ -26,7 +26,7 @@ def test_all(path): with open(path, 'r') as f: test: dict = json.load(f) - checks_passed = cvm.test(test) + checks_passed = svm.test(test) assert checks_passed > 0, "Nothing checked" @@ -35,5 +35,5 @@ def test_bench_routine(): name = "std.if - iE-Ie-Ie" with open(path, 'r') as f: test: dict = json.load(f) - checks_passed = cvm.test(test, name) + checks_passed = svm.test(test, name) assert checks_passed > 0, "Nothing checked"