Giter VIP home page Giter VIP logo

sati's Introduction

Code style: black Test

Semiotic Analysis of Test Items

Development

With a working version of Python 3.8 and Pipenv:

  1. Install dependencies (use sync instead of install to use Pipfile.lock instead, and ensure a deterministic environment).

    $ pipenv sync --dev
    
  2. Install pre-commit hooks.

    $ pipenv run pre-commit install
    
  3. Create a database (if not created yet) and migrate. Only PostgreSQL is supported. Database settings must be specified in a .env file (see .env_tempate for details).

    $ pipenv run python manage.py migrate
    
  4. Create a superuser.

    $ pipenv run python manage.py createsuperuser
    
  5. Collect static files from installed apps.

    $ pipenv run python manage.py collectstatic
    
  6. Start development server and go to http://localhost:8000/admin/.

    $ pipenv run python manage.py runserver localhost:8000
    

Testing

  • Tests

    $ pipenv run python manage.py test
    
  • Linting and formatting

    $ pipenv run pre-commit run --all-files
    

Docker

A production-ready deployment can be brought up with just docker-compose up --build [-d]. This will start a container for the django app and another for the PostgreSQL database server. Note that the app is served by gunicorn on port 8000 which is exposed to the docker host, and the /static and /media roots are mounted from the host filesystem, as this is intended to be run behind a webserver on the docker host which serves up /static and /media and reverse-proxies the app.

Running the Django development server is possible with a command like the example below, but note that the docker image is compiled without installing the Django dev. dependencies.

docker-compose run --rm --name sati-app -p 8000:8000 django python manage.py runserver 0.0.0.0:8000

To run with DEBUG=True (and have the dev. server serve static assets) it is necessary to install the --dev dependencies. This can be done (if needed for some reason) by getting a shell:

docker-compose run --rm --name sati-app -p 8000:8000 django ash

and using the following commands:

apk add gcc python3-dev musl-dev;
pipenv install --deploy --system --ignore-pipfile --dev
export DEBUG=True
./manage.py runserver 0.0.0.0:8000

See the notes in .env_tempate for further details.

sati's People

Contributors

broadwell avatar simonwiles avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sati's Issues

a checkbox to indicate primary coding?

As we started to double code and compare codings of items, I was wondering if it's possible to add a function (like a checkbox on the top of the form) that will allow us to indicate which coding should be treated as the primary or final decision?

Thanks!
Hsiaolin

Coding reconciliation

From Hsiaolin's email:

As for the actual coding page/functionality, we would like to do double coding—2 coders each code the same items independently, then compare and negotiate to establish the final coding—on the platform directly. To do so, we would like to be able to:
...
• compare two codings and highlight differences for further negotiation;
• create a third form (that includes the final coding decisions), or mark an existing form (with some notes next to changes) as the final form.

This is mainly a UI issue, I think.

Setting Coding Scheme to ------- generates error

The coding scheme now defaults to Wang, which is cool, but manually setting the coding scheme to the "undefined" option (--------), for whatever reason, leads to a Django error page when the item is saved, with the following unhelpful message:

No such file or directory: '[SATI_ROOT]/sati/items/schemas/.json'

Probably this field should be set to required so that attempting to use the "undefined" option generates an in-band This field is required. message, as happens with most other input fields.

Automatic OCR of new image uploads?

This would be nice to have, perhaps a sidecar Tesseract container could be used? (Probably on a cron-ed basis, rather than on a trigger of any kind.)

Additional filters to facilitate RA workflows

In addition, we would also like some filter settings or some kind of “assign” function to help our coders to find and work on the same new items with ease.

I think filter (and probably a column) for "has codings" and another (without a list column) for "coded by" probably takes care of at least 80% of this.

Should it be possible to add a coding via the interface with no attributes checked?

This is currently allowed. It's not obvious why one would want to do this via the interface; not choosing an attribute is more likely to be a mistake that perhaps should be flagged via an in-band error message noting that at least one attribute must be selected.

In the case of bulk uploads, though, there probably could be a scenario in which a coding is created but not filled in, with the intention that someone would fill it in later via the interface. But in that (hypothetical) case, the initial coding creation wouldn't be done via the interface, so this question wouldn't really apply.

Unable to expand/edit codings added via the interface

To reproduce: create an item, add a coding, save the item, browse to the item's codings, try to expand a coding (to view or edit it) by clicking on the arrow or the label (e.g., Coding: Coding by [email protected], 2021-01-14).

It seems as though the click event isn't triggering the intended style change to expand the coding display element.

This has only been tested/reproduced with dummy test items created from scratch via the interface. Not sure if it would happen with codings added to items created via bulk update.

Make inline Codings tabbed or similar

Stacked or tabular inlines are cumbersome in this context -- can we use tabs or a similar mechanism to make these a little less unwieldy? Perhaps this becomes easier if #8 is implemented?

Tests are failing because of invalid cache-restore on GitHub Actions

      - name: Set up Python 3.8
        uses: actions/setup-python@v2
        with:
          python-version: 3.8

This results in the the latest patch release for 3.8 being used (3.8.x) as seems reasonable. However, if a cached .venv created with a different patch version is restored, the build fails (not sure if this might be considered a pipenv bug?).

In any event, two options present themselves:

  1. Pin the patch version of Python (for the Actions runner, if not necessarily for the project as a whole).
  2. Tag the cache with the major.minor.patch version of python it was built with, and invalidate as appropriate.

Clean up the JSON dumps

The JSON dumps in sati-data could be cleaner -- e.g. the codings could be reformatted to prevent so much bloat (without sacrificing readable diffs), and/or is there a way to dump the individual models to JSON files instead of the entire app?

type on coding option 4.2.2B

It's currently showing : 4.2.2B Discrete: numeric, but should be corrected to 4.2.2B: Discrete: Textual.

Thanks!

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.