Skip to main content

Functional python that shields users from breaking changes.

Project description

A_GIS Python Package

pip install A_GIS

Pronounced with a long "a" like AEGIS, this is a package for functional python.

Distill and recompose

Checkout out notebooks/roundtrip.ipynb for an example of round-tripping.

In the __A_GIS__ directory we can have the segmented data so that AI can operate on different parts more efficiently.

The basic sequence is

  1. raw function only (8 lines or less ideally)
  2. add comments and spacing
  3. add docstring
  4. send through formatter
  5. this is now a complete function like someone would want to see in a code base

To split it up again we go in reverse.

  1. remove docstring
  2. remove comments and spacing (save in file)
  3. save raw function

Now you can see easily if the raw function changed. Once this iteration converges, the diff should be zero.

This process has advantages in that we can isolate the docstring and work on making that beautiful.

It could get examples, and all kinds of crazy awesome reformatting as its own document. Then we can reapply comments to the raw source, THEN the docstring, then format. We could send this to an AI now to create better comments and then ONLY update the comments file. I think the comments are somewhat dependent on the docstring so it's nice to have this flow of regenerating comments assuming a certain docstring and visibility of the whole file.

After splitting back out and saving the raw function, you can see (with git diff for example), if the AI changed the execution of the code. One could imagine asking the AI to split a function into several that don't exceed e.g. 9 lines for example.

This scheme gives us a way to then split those functions and send them to their place on the file system.

By going to such small granularity, we should be able to fit in many AIs token counts and they should be able to design tests and examples much easier.

We could also, based on similarity metrics for the raw functions, make sure AI aren't creating a bunch of extra functions. I.e. if they create a new one that has high similarity to an existing one, we could ask it to use the existing one instead, or propose modifications to the existing one, e.g. optional arguments, that would make it work.

It would be interesting to see what an AI would generate in terms of a code base with this approach. It should arrive at lots of small functions that are basically idioms, like A_GIS.File.read().

You should be able to apply this approach hierarchically to handle tests for example, each test a function. This should be a totally functional based system. Inside the functions we may want helper classes, especially for testing. We should start these names with an _ to make sure they do not appear in the public API.

Finally, it should be possible to hash the raw function content like IPFS and provide these in a distributed computing framework, where you basically call a function by the hash, output = A_GIS.<hash>(input) which ensures you get a specific version of that function even across different versions of A_GIS. All A_GIS functions should require keywords which may help with handling serialized data in dictionaries and such.

Nice Tree Output

tree -I *.pyc -I __A_GIS__ -I __init__.py -I __pycache__ -I tests A_GIS/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

A_GIS-0.8.1.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

A_GIS-0.8.1-py3-none-any.whl (35.7 kB view details)

Uploaded Python 3

File details

Details for the file A_GIS-0.8.1.tar.gz.

File metadata

  • Download URL: A_GIS-0.8.1.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for A_GIS-0.8.1.tar.gz
Algorithm Hash digest
SHA256 2d555b9aa45aaf9addee2b9a67ecfe830a8e62cb2e55cebda46fb7ce871656ac
MD5 cbb87d1a530a42b7681ff6af22c0e100
BLAKE2b-256 9c57da33e3a0188b45f3a413594c1edbbc8e3cd66926f4e4767cc42c4ee99061

See more details on using hashes here.

File details

Details for the file A_GIS-0.8.1-py3-none-any.whl.

File metadata

  • Download URL: A_GIS-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 35.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.8

File hashes

Hashes for A_GIS-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 68f4a3645fe6711c1815394f2063b605f5561bf90d90e9b6139449880661bfd9
MD5 43eb4d0c5c93acb0b4a3e6e1571401f9
BLAKE2b-256 28f32bfb9bb25e7084cb552cf374bcc7059000d2d4772b4afad72ec1021fc718

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page