Code Monkey home page Code Monkey logo

sage_sample's Introduction

Sage Sample Package

This package is designed as as simple SageMath package example to serve as a good practice reference for package developers. We follow python recommendations and adapt them to the SageMath community. You can find more advanced documentation on python package creation on How To Package Your Python Code.

Installation

Local install from source

Download the source from the github and run this command from the repo root:

$ sage  -pip install --upgrade --no-index -v .

Equivalently, you can use the Makefile install command:

$ make install

Install from PyPI

TODO: distribute on PyPI.

Usage

Once the package is installed, you can use it on Sage with:

sage: from sage_sample import answer_to_ultimate_question
sage: answer_to_ultimate_question()
42

Setup

All packaging setup is done through the setup.py. To create your own package follow the strcuture of the file and change the parameters accordingly.

Source code

All source code is stored in the folder sage_sample using the same name as the package. This is not mandatory but highly recommended for clarity. All source folder must contain a __init__.py file with needed includes.

Tests

Define your tests as doctest in your source code following SageMath good practice. Examples of documentation and tests are given in this package. Once the package is installed, you can use the SageMath test system configured in setup.py to run the tests:

$ sage setup.py test

Or for short:

$ make test

Documentation

You can use the Sage Sphinx installation to generate the documentation of the package:

$ cd docs
$ sage -sh -c "make html"

Or for short:

$ make doc

For this to work on your own package, make sure you follow the same structure as we do here.

  • Create a docs folder containing the exact same Makefile and a source folder.
  • Copy and paste the docs/source/conf.py file from this package and update the few project specific variables at the beginning of the file.
  • Create an index.rst file as well as a <module name>.rst file for each module you want on the documentation.

sage_sample's People

Contributors

nthiery avatar vivianepons avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.