Skip to main content

Core implementation of EOQ3 for python

Project description

eoq3 - EOQ3 core implementation for python

This implements EOQ3 domains, values, queries and commands in python. It is the central module of the EOQ3 implementation for python. It contains a ready-to-use domainwithmdb for programmatic model interactions.

Getting started example

This example implements the "Why EOQ?" example and some additional prints of model information.

from eoq3.domainwithmdb import DomainWithMdb
from eoq3.command import Crt, Get,Set #commands
from eoq3.query import Cls,Pth #queries
from eoq3.concepts import * #import constants as CONCEPTS, ....
from eoq3.examples.warehouse import CreateWarehouseM1Model, CreateWarehouseM2Model #creation of example models
# currently PyecoreMdb is the only local domain. eoq3pyecoremdb must be installed.
from eoq3pyecoremdb import PyEcoreMdb #requres pyecoremdb to be installed

# Initialize a local domain
mdb = PyEcoreMdb()
domain = DomainWithMdb(mdb)
# Init warehouse meta and user model
CreateWarehouseM2Model(domain) #open function to see model creation commands
CreateWarehouseM1Model(domain) #open function to see model creation commands
# Would you like to get a list of articles?
articles = domain.Do( Get( Cls('Article') ) )
print("Articles: %s"%(articles))
# Would you like to know which one is sold less than 3-times?
badArticles = domain.Do( Get( Cls('Article').Sel(Pth('sells').Les(3)) ) )
print("Bad articles: %s"%(badArticles))
# You might want to reduce their price by 10%?
nameAndPrice = domain.Do( Get( Cls('Article').Zip([Pth('name'),Pth('price')])))
print("Article prices: %s"%(nameAndPrice))
domain.Do( Set( 
	Cls('Article').Sel(Pth('sells').Les(3)),
	'price',
	Cls('Article').Sel(Pth('sells').Les(3)).Pth('price').Mul(0.9) 
) )
nameAndPrice = domain.Do( Get( Cls('Article').Zip([Pth('name'),Pth('price')])))
print("Article prices: %s"%(nameAndPrice))
# Would you like to see a list of the names of the categories of the badly selling articles sorted by ascendingly?
badCategories = domain.Do( Get( Cls('Article').Sel(Pth('sells').Les(3)).Met('PARENT').Pth('name').Uni([]).Idx('SORTASC') ) )
print(badCategories)

This example is available as https://gitlab.com/eoq/py/pyeoq/Examples/Eoq3/WhyWarehouseExample.py

Documentation

For more information see EOQ3 documentation: https://eoq.gitlab.io/doc/eoq3/

pyeoq repository

Pyeoq module's source can be found here: https://gitlab.com/eoq/py/pyeoq

Author

2024 Bjoern Annighoefer

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

eoq3-2.9.15.tar.gz (119.0 kB view details)

Uploaded Source

Built Distribution

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

eoq3-2.9.15-py3-none-any.whl (146.0 kB view details)

Uploaded Python 3

File details

Details for the file eoq3-2.9.15.tar.gz.

File metadata

  • Download URL: eoq3-2.9.15.tar.gz
  • Upload date:
  • Size: 119.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for eoq3-2.9.15.tar.gz
Algorithm Hash digest
SHA256 b0e27bd717e4e3c7063aba3b2e06edb09d5d5da136ea7a2b9fcf04c9db289fb6
MD5 43d5f5e81a9ae0994b85080ef566a90e
BLAKE2b-256 569e38aacc59dc05562ce6311e853c03b747bba272400c3441bb4f059291115b

See more details on using hashes here.

File details

Details for the file eoq3-2.9.15-py3-none-any.whl.

File metadata

  • Download URL: eoq3-2.9.15-py3-none-any.whl
  • Upload date:
  • Size: 146.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for eoq3-2.9.15-py3-none-any.whl
Algorithm Hash digest
SHA256 69e3f4a9930ed2abf6cc37deb61cb2d0c478703a7c3c19f12238663028212ec9
MD5 780a2c90c2becb1e463dbedc1b2a4acc
BLAKE2b-256 4d4a60680ae92c76035858d93e019611316ebf97decb882311415023101e9c16

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