A Django app providing Rest APIs to create CosApp system.
Project description
CosApp Creator
cosapp_creator
is a Django application providing a web interface to create CosApp systems.
Installation
You can install cosapp_creator
using pip
or conda
# Using pip
pip install cosapp_creator
# Using conda
conda install -c conda-forge cosapp_creator
Getting started
cosapp_creator
provides the cosapp-creator
command to interact with the web server.
- Before starting the application for the first time, you need to create the database:
cosapp-creator migrate
- To start the application in production mode, you need to have
gunicorn
installed:
# Start the web server at the default 8000 port
cosapp-creator start
cosapp-creator
uses gunicorn
to serve the Django application, any arguments after start
will be passed to gunicorn
. You can refer to gunicorn
documentation for advanced configuration, for example, to start the application with 4 workers:
cosapp-creator start --workers 4
By default, the frontend will connect to the API server at http://127.0.0.1:8000
, you can modify this URL by setting the variable COSAPP_CREATOR_BASE_URL
before starting up the server:
# Start the web server at a custom port
COSAPP_CREATOR_BASE_URL=http://127.0.0.1:1234 cosapp-creator start -b 0.0.0.0:1234
- To start the application in development mode:
cosapp-creator runserver
- To show all available commands:
cosapp-creator -h
Using the application
Import package
The first step in creating an assembly is to import a package. To do so, the "Import Package/Assembly" button must be clicked, and the JSON file describing the Python module must be imported. This file can be generated by the parse_module
function in CoSApp.
Use resulting code
Clicking on "Generate code" will display a frame containing the code to create the object class in the graph.
To use it, this code needs to be executed in a Python environment in which the modules used by the assembly are installed.
This code will create the class. To instantiate an object, systemName = ClassName('systemName')
has to be added after the code for the class.
# Code generated by CoSApp Creator
from cosapp.base import System
import module
class Assembly(System):
def setup(self):
self.add_child(module.SystemClass('sys1'))
self.add_child(module.SystemClass('sys2'))
def compute(self):
pass
# Instanciate object
assembly = Assembly('assembly')
Change assembly or child system names
In order to change the name of the assembly or the name of any child system, the old name must be double-clicked. An input field will appear, and it will be possible to write a new name. To confirm it, it is possible to click "Enter" or to just click outside of the field.
Get details on ports
A description of a port in a child system will be shown by hovering over it with the mouse. If more details are needed, it is possible to click on the port, and a more detailed description will be shown.
Port description before clicking :
Port description after click :
Kwargs
It is possible to change the value of each kwargs in a system by right-clicking this system. However, if the value of a kwarg changes the structure of a system, this change will ne be reflected in CoSApp Creator, and it may cause bugs.
Pullings
The assembly inputs and outputs are represented by these two nodes.
New pullings are created by linking any port from a child system to the white symbol.
It is also possible to link two children inputs to one parent input, by linking one parent port to two children.
Loops and mathematical problem
Each system's mathematical problem, if it exists, can be viewed by hovering over its sigma symbol.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cosapp_creator-0.1.1.tar.gz
.
File metadata
- Download URL: cosapp_creator-0.1.1.tar.gz
- Upload date:
- Size: 711.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05118d7cfe9b9677b11c3dec47154ed4590fcc288108a2897a0221d0993c4b97 |
|
MD5 | 9b05f6b9aec8afff91806ea0e64ed0f1 |
|
BLAKE2b-256 | 48d39e122c9a061507423bd1d2de729a153aca16926b19d93ad20583116643ef |
File details
Details for the file cosapp_creator-0.1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: cosapp_creator-0.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 495.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7973b35d233867800d2cdde2fefbd24945f699024c5cb24d4517f322915da149 |
|
MD5 | 7e907b0a97811bbe1bf93d006a9fd198 |
|
BLAKE2b-256 | fbf70432f60c33878a997a8c79324fbff4a30dff74e843ff3204ce65a86a46b6 |