Skip to content

Commit

Permalink
Merge pull request #2 from H-IAAC/dev
Browse files Browse the repository at this point in the history
0.2.0 modifications
  • Loading branch information
EltonCN authored Nov 26, 2024
2 parents ac4e1bb + 045c0f1 commit ba25fdb
Show file tree
Hide file tree
Showing 39 changed files with 1,354 additions and 44 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Simple workflow for deploying static content to GitHub Pages
name: Build and deploy documentation

on:
# Runs on pushes targeting the default branch
release:
types: [published]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
cd docs
python3 install_doc_requirements.py
cd ..
- name: Install pandoc
uses: pandoc/actions/setup@v1
- name: Build documentation
run: |
cd docs
make html
cd ..
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload docs dir
path: './docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
66 changes: 66 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
release-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Build release distributions
run: |
# NOTE: put your own distribution build steps here.
python -m pip install build
python -m build
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/

pypi-publish:
runs-on: ubuntu-latest

needs:
- release-build

permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

# Dedicated environments with protections for publishing are strongly recommended.
environment:
name: pypi
# OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
url: https://pypi.org/project/cst-python/

steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/

- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.exclude": {
"**/.git": false
}
}
57 changes: 57 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: CST-Python
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Elton
family-names: Cardoso do Nascimento
email: [email protected]
affiliation: H.IAAC-UNICAMP
orcid: 'https://orcid.org/0009-0005-0480-6970'
- given-names: Paula
family-names: Dornhofer Paro Costa
email: [email protected]
affiliation: H.IAAC-UNICAMP
orcid: 'https://orcid.org/0000-0002-1534-5744'
doi: 10.5281/zenodo.14057065
url: https://github.com/H-IAAC/CST-Python'
repository-code: 'https://github.com/H-IAAC/CST-Python'
repository-artifact: 'https://pypi.org/project/cst-python/'
abstract: >-
CST-Python is a Python module of the CST, the Cognitive
Systems Toolkit, a toolkit for the construction of
cognitive systems and cognitive architectures.
keywords:
- cognitive architecture
- cst
- toolkit
- python
license: LGPL-3.0
references:
- title: "CST"
type: 'software'
repository-code: 'https://github.com/CST-Group/cst'
authors:
- given-names: Ricardo
family-names: Ribeiro Gudwin
- given-names: Klaus
family-names: Raizer
- given-names: André
family-names: Luís Ogando Paraense
- given-names: Suelen
family-names: Mapa de Paula
- given-names: Vera
family-names: Aparecida de Figueiredo
- given-names: Elisa
family-names: Calhau de Castro
- given-names: Eduardo
family-names: Fróes
- given-names: Wandemberg
family-names: Santana Pharaoh Gibaut


26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![](https://img.shields.io/pypi/v/cst_python?style=for-the-badge)](https://pypi.org/project/cst_python) [![](https://img.shields.io/pypi/l/cst_python?style=for-the-badge)](https://github.com/H-IAAC/CST-Python/blob/main/LICENSE) [![](https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/H-IAAC/CST-Python)
[![](https://img.shields.io/pypi/v/cst_python?style=for-the-badge)](https://pypi.org/project/cst_python) [![](https://img.shields.io/pypi/l/cst_python?style=for-the-badge)](https://github.com/H-IAAC/CST-Python/blob/main/LICENSE) [![](https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/H-IAAC/CST-Python) [![](https://img.shields.io/badge/-Documentation-fe9c22?style=for-the-badge&link=https%3A%2F%2Fh-iaac.github.io%CST-Python%2F)](https://h-iaac.github.io/CST-Python) [![](https://img.shields.io/badge/DOI-10.5281/zenodo.14057065-1082c3?style=for-the-badge)](https://doi.org/10.5281/zenodo.14057065)

# CST-Python

Expand Down Expand Up @@ -33,20 +33,36 @@ This project was developed as part of the Cognitive Architectures research line
pip install .
```

## Citation

<!--Don't remove the following tags, it's used for placing the generated citation from the CFF file-->
<!--CITATION START-->
```bibtext
@software{Cardoso_do_Nascimento_CST-Python,
author = {Cardoso do Nascimento, Elton and Dornhofer Paro Costa, Paula},
doi = {10.5281/zenodo.14057065},
title = {CST-Python},
url = {https://github.com/H-IAAC/CST-Python'}
}
```
<!--CITATION END-->
## Authors
- (2023-) Elton Cardoso do Nascimento: M. Eng. student, FEEC-Unicamp
- (2023-) Elton Cardoso do Nascimento: M. Eng. student, FEEC-UNICAMP
- (Advisor, 2023-) Paula Dornhofer Paro Costa: Professor, FEEC-UNICAMP
## Acknowledgements
This project is part of the Hub for Artificial Intelligence and Cognitive Architectures
(H.IAAC- Hub de Inteligência Artificial e Arquiteturas Cognitivas). We acknowledge the
support of PPI-Softex/MCTI by grant 01245.013778/2020-21 through the Brazilian Federal Government.
Project supported by the brazilian Ministry of Science, Technology and Innovations, with resources from Law No. 8,248, of October 23, 1991
## License
CST-Python is a code derived from [main cst code](https://github.com/CST-Group/cst).
```
Copyright 2024 H.IAAC
Copyright 2016 CST-Group
Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 3 (the "License");
you may not use this file except in compliance with the License.
Expand Down
Empty file added docs/.nojekyll
Empty file.
22 changes: 22 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?= -j 4
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@sphinx-apidoc --force -e -E -M --templatedir=_templates ../src -o auto_doc
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@python tear_down.py
7 changes: 7 additions & 0 deletions docs/_static/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* necessary to remove the duplicated toctree entries created by referencing index in the sphinx index.rst */
.wy-menu-vertical > ul > li:nth-child(1),
.wy-menu-vertical > ul > li:nth-child(2),
.wy-nav-content .toctree-wrapper > ul > li:nth-child(1),
.wy-nav-content .toctree-wrapper > ul > li:nth-child(2) {
display: none;
}
21 changes: 21 additions & 0 deletions docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% extends "!layout.html" %}
{% block footer %} {{ super() }}

<style>
/* Sidebar header (and topbar for mobile) */
.wy-side-nav-search, .wy-nav-top
{
background: #fe9c22;
}

.wy-menu-vertical header, .wy-menu-vertical p.caption
{
color: #fe9c22;
}

/* Sidebar */
/*.wy-nav-side {
background: #fe9c22;
}*/
</style>
{% endblock %}
52 changes: 52 additions & 0 deletions docs/_templates/package.rst.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{%- macro automodule(modname, options) -%}
.. automodule:: {{ modname }}
{%- for option in options %}
:{{ option }}:
{%- endfor %}
{%- endmacro %}

{%- macro toctree(docnames) -%}
.. toctree::
:maxdepth: {{ maxdepth }}
{% for docname in docnames %}
{{ docname }}
{%- endfor %}
{%- endmacro %}

{%- if is_namespace %}
{{- [pkgname, "namespace"] | join(" ") | e | heading }}
{% else %}
{{- [pkgname, "package"] | join(" ") | e | heading }}
{% endif %}

{%- if is_namespace %}
.. py:module:: {{ pkgname }}
{% endif %}

{%- if modulefirst and not is_namespace %}
{{ automodule(pkgname, automodule_options) }}
{% endif %}

{%- if subpackages %}
{{ toctree(subpackages) }}
{% endif %}

{%- if submodules %}
{% if separatemodules %}
{{ toctree(submodules) }}
{% else %}
{%- for submodule in submodules %}
{% if show_headings %}
{{- [submodule, "module"] | join(" ") | e | heading(2) }}
{% endif %}
{{ automodule(submodule, automodule_options) }}
{% endfor %}
{%- endif %}
{%- endif %}

{%- if not modulefirst and not is_namespace %}
Module contents
---------------

{{ automodule(pkgname, automodule_options) }}
{% endif %}
Loading

0 comments on commit ba25fdb

Please sign in to comment.