Skip to content

Commit

Permalink
Merge branch 'hotfix/1.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
philipbelesky committed Feb 25, 2017
2 parents 66b9697 + 6f4e16c commit 88c0235
Show file tree
Hide file tree
Showing 35 changed files with 357 additions and 184 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
language: python
dist: trusty
sudo: required
python:
- "3.4"
- "3.5"
- "3.6"
addons:
postgresql: "9.5"
postgresql: "9.6"
services:
- postgresql
install:
Expand Down
29 changes: 29 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@ Change Log
==========


1.2.1
-----
*Release date: 25 February 2017*

- Printable feedback forms will now display the default rating scale, any configured introduction text, and better prompt you to add additional questions
- A number of other minor bug fixes


1.2.0 (Foldex)
--------------
*Release date: 15 February 2017*

- Changed the core workflow by splitting display- and motion- related activities into separate pages to simplify each stage of running a round
- Added support for Docker-based installations to make local/offline installations much more simple
Expand All @@ -19,6 +28,7 @@ Change Log

1.1.7
-----
*Release date: 31 January 2017*

- Yet more minor bug fixes
- The auto-allocation UI will now detail your minimum rating setting better
Expand All @@ -27,19 +37,22 @@ Change Log

1.1.6
-----
*Release date: 19 January 2017*

- A number of minor bug fixes
- Added basic infrastructure for creating tabbycat translations


1.1.5
-----
*Release date: 12 January 2017*

- A number of minor bug fixes and improvements to documentation


1.1.4
-----
*Release date: 25 November 2016*

- Redesigned the footer area to better describe Tabbycat and to promote donations and related projects
- Slight tweaks to the site homepage and main menus to better accomodate the login/log out links
Expand All @@ -48,6 +61,7 @@ Change Log

1.1.3
-----
*Release date: 15 September 2016*

- Fixed bug affecting some migrations from earlier versions
- Made latest results show question mark rather than crash if a team is missing
Expand All @@ -57,6 +71,7 @@ Change Log

1.1.2
-----
*Release date: 14 September 2016*

- Allow panels with even number of adjudicators (with warnings), by giving chair the casting vote
- Removed defunct person check-in, which hasn't been used since 2010
Expand All @@ -69,12 +84,14 @@ Change Log

1.1.1
-----
*Release date: 8 September 2016*

- Fixed a bug where the team standings and team tab would crash when some emoji were not set


1.1.0 (Egyptian Mau)
--------------------
*Release date: 3 September 2016*

- Added support for the United Asian Debating Championships style
- Added support for the World Schools Debating Championships style
Expand All @@ -85,6 +102,7 @@ Change Log

1.0.1
-----
*Release date: 19 August 2016*

- Fixed a minor bug with the visual importer affecting similarly named institutions
- Fixed error message when user tries to auto-allocate adjudicators on unconfirmed or released draw
Expand All @@ -93,6 +111,8 @@ Change Log

1.0.0 (Devon Rex)
-----------------
*Release date: 16 August 2016*

Redesigned and redeveloped adjudicator allocation page
- Redesigned interface, featuring clearer displays of conflict and diversity information
- Changes to importances and panels are now automatically saved
Expand Down Expand Up @@ -120,6 +140,8 @@ Feedback

0.9.0 (Chartreux)
-----------------
*Release date: 13 June 2016*

- Added a beta implementation of the break rounds workflow
- Added venue constraints, to allow participants or divisions to preferentially be given venues from predefined groups
- Added a button to regenerate draws
Expand All @@ -134,6 +156,8 @@ Feedback

0.8.3
-----
*Release date: 4 April 2016*

- Restored and reworking printing functionality for scoresheets/feedback
- Restored Edit Venues and Edit Matchups on the draw pages
- Reworked tournament data importers to use csv.DictReader, so that column order in files doesn't matter
Expand All @@ -144,12 +168,15 @@ Feedback

0.8.2
-----
*Release date: 20 March 2016*

- Fixed issue where scores from individual ballots would be deleted when any other panel in the round was edited
- Fixed issue where page crashes for URLs with "tab" in it but that aren't recognized tab pages


0.8.1
-----
*Release date: 15 March 2016*

- Fixed a bug where editing a Team in the admin section could cause an error
- Added instructions on how to account for speakers speaking twice to docs
Expand All @@ -158,6 +185,7 @@ Feedback

0.8.0 (Bengal)
--------------
*Release date: 29 February 2016*

- Upgraded to Python 3.4, dropped support for Python 2
- Restructured directories and, as a consequence, changed database schema
Expand All @@ -174,6 +202,7 @@ Feedback

0.7.0 (Abyssinian)
------------------
*Release date: 31 July 2015*

- Support for multiple tournaments
- Improved and extensible tournament data importer
Expand Down
24 changes: 14 additions & 10 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,17 @@ You should then be able to preview the docs at `127.0.0.1:7999 <http://127.0.0.1
Release Checklist
=================

1. Bump version numbers in ``docs/conf.py`` and ``tabbycat/settings.py``
2. Update the main ``CHANGELOG.rst`` file
3. Shift remaining issues from the Github Milestone
4. Create and finish the release branch as per git-flow
5. Ensure the tag is correct (``vX.Y.Z``) and published to Github
6. Back-merge ``master`` to the ``kitten`` branch
7. Back-merge ``develop`` to the in-progress feature branches
8. Push ``master`` to the release pipeline repository
9. Issue a formal release with change notes on Github
10. Post change notes on the Facebook group
1. Check that all migrations have been generated and committed into Git
2. Bump version number in ``docs/conf.py``
3. Bump version number and (if applicable) codename in ``tabbycat/settings.py``
4. Update the main ``CHANGELOG.rst`` file
5. Check that the last Travis CI build passed
6. Check that ``deploy_heroku.py`` still works
7. Shift remaining issues from the Github Milestone
8. Create and finish the release branch as per git-flow
9. Ensure the tag is correct (``vX.Y.Z``) and published to GitHub
10. Back-merge ``master`` to the ``kitten`` branch
11. Back-merge ``develop`` to the in-progress feature branches
12. Push ``master`` to the release pipeline repository
13. Issue a formal release with change notes on GitHub
14. Post change notes on the Facebook group
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

# General information about the project.
project = 'Tabbycat'
copyright = '2016, Philip Belesky, Chuan-Zheng Lee'
copyright = '2017, Philip Belesky, Chuan-Zheng Lee'
author = 'Philip Belesky, Chuan-Zheng Lee'

# The version info for the project you're documenting, acts as replacement for
Expand All @@ -60,7 +60,7 @@
# The short X.Y version.
version = '1.2'
# The full version, including alpha/beta/rc tags.
release = '1.2.0'
release = '1.2.1'

rst_epilog = """
.. |vrelease| replace:: v{release}
Expand Down
4 changes: 2 additions & 2 deletions docs/install/heroku.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ If you want to :ref:`import tournament data <importing-initial-data>` from CSV f
1. Install dependencies
-----------------------

- Install the `Heroku Command Line Interface (CLI) <https://devcenter.heroku.com/articles/heroku-cli>`_. Then open a command shell and log in using ``heroku login``.
- Install the `Heroku Command Line Interface (CLI) <https://devcenter.heroku.com/articles/heroku-cli>`_, then log in with the command ``heroku login``.

- Windows users need to install **Python**. Follow the instructions in (only!) :ref:`part 1(a) of our Windows instructions <install-python-windows>`.
- Windows users need to install **Python**. Follow (only!) :ref:`part 1(a) of our Windows instructions <install-python-windows>`.

- If you don't already have **Git**, follow the `instructions on the GitHub website <https://help.github.com/articles/set-up-git>`_ to set up Git.

Expand Down
2 changes: 1 addition & 1 deletion docs/install/osx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Download and run the `node.js Mac OS X Installer (.pkg) <https://nodejs.org/en/d

3. In terminal type in::

$ PATH="/Applications/Postgres.app/Contents/Versions/9.5/bin:$PATH"
$ PATH="/Applications/Postgres.app/Contents/Versions/9.6/bin:$PATH"

4. Install Tabbycat
================================================================================
Expand Down
2 changes: 1 addition & 1 deletion docs/install/wsl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ First, install `PostgreSQL for Windows <https://www.postgresql.org/download/wind
.. parsed-literal::
curl -sL https\:\/\/deb.nodesource.com/setup_5.x | sudo -E bash - # add Node.js source repository
sudo apt-get install python3-dev python3-venv libpq-dev postgresql-client-9.5 nodejs
sudo apt-get install python3-dev python3-venv libpq-dev postgresql-client-9.6 nodejs
# either
wget https\:\/\/github.com/czlee/tabbycat/archive/|vrelease|.tar.gz
Expand Down
1 change: 1 addition & 0 deletions manage.py
2 changes: 1 addition & 1 deletion tabbycat/adjallocation/allocator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ def allocate_adjudicators(round, alloc_class):
if round.draw_status != round.STATUS_CONFIRMED:
raise RuntimeError("Tried to allocate adjudicators on unconfirmed draw")

debates = round.get_draw()
debates = round.debate_set.all()
adjs = list(round.active_adjudicators.filter(novice=False))
allocator = alloc_class(debates, adjs, round)

Expand Down
24 changes: 16 additions & 8 deletions tabbycat/adjallocation/hungarian.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def __init__(self, *args, **kwargs):

self.DUPLICATE_ALLOCATIONS = t.pref('duplicate_adjs')

self.FEEDBACK_WEIGHT = t.current_round.feedback_weight

def populate_adj_scores(self, adjudicators):
for adj in adjudicators:
adj._hungarian_score = adj.weighted_score(self.FEEDBACK_WEIGHT)

def calc_cost(self, debate, adj, adjustment=0):
cost = 0

Expand All @@ -39,38 +45,40 @@ def calc_cost(self, debate, adj, adjustment=0):
# Similarly normalise adj scores to the 0-5 range expected
score_min = self.MIN_SCORE
score_range = self.MAX_SCORE - score_min
normalised_adj_score = (adj.score - score_min) / score_range * 5 + 0
normalised_adj_score = (adj._hungarian_score - score_min) / score_range * 5 + 0

if normalised_adj_score > 5.0:
logger.warning("%s's score %s is larger than the range" % (adj.name, adj.score))
logger.warning("%s's score %s is larger than the range" % (adj.name, adj._hungarian_score))
elif normalised_adj_score < 0.0:
logger.warning("%s's score %s is smaller than the range" % (adj.name, adj.score))
logger.warning("%s's score %s is smaller than the range" % (adj.name, adj._hungarian_score))

cost += self.CONFLICT_PENALTY * adj.conflict_with(debate.aff_team)
cost += self.CONFLICT_PENALTY * adj.conflict_with(debate.neg_team)
cost += self.HISTORY_PENALTY * adj.seen_team(debate.aff_team, debate.round)
cost += self.HISTORY_PENALTY * adj.seen_team(debate.neg_team, debate.round)

impt = (normalised_importance or self.DEFAULT_IMPORTANCE) + adjustment
diff = 5 + impt - adj.score
diff = 5 + impt - adj._hungarian_score
if diff > 0.25:
cost += 100000 * exp(diff - 0.25)

cost += (self.MAX_SCORE - adj.score) * 100
cost += (self.MAX_SCORE - adj._hungarian_score) * 100

return cost

def allocate(self):
from adjallocation.allocation import AdjudicatorAllocation

self.populate_adj_scores(self.adjudicators)

# Remove trainees
self.adjudicators = [a for a in self.adjudicators if a.score >= self.MIN_VOTING_SCORE]
self.adjudicators = [a for a in self.adjudicators if a._hungarian_score >= self.MIN_VOTING_SCORE]
logger.info("There are %s non-trainee adjudidcators", len(self.adjudicators))

# Sort adjudicators and debates in descending score/importance
self.adjudicators_sorted = list(self.adjudicators)
shuffle(self.adjudicators_sorted) # Randomize equally-ranked judges
self.adjudicators_sorted.sort(key=lambda a: a.score, reverse=True)
self.adjudicators_sorted.sort(key=lambda a: a._hungarian_score, reverse=True)
self.debates_sorted = list(self.debates)
self.debates_sorted.sort(key=lambda a: a.importance, reverse=True)

Expand Down Expand Up @@ -185,7 +193,7 @@ def allocate(self):
# that the chair is the highest-ranked adjudicator in the panel
for i, d in enumerate(panel_debates):
a = AdjudicatorAllocation(d)
p[i].sort(key=lambda a: a.score, reverse=True)
p[i].sort(key=lambda a: a._hungarian_score, reverse=True)
a.chair = p[i].pop(0)
a.panellists = p[i]
alloc.append(a)
Expand Down
10 changes: 5 additions & 5 deletions tabbycat/adjallocation/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from participants.utils import regions_ordered
from tournaments.models import Round
from tournaments.mixins import RoundMixin
from utils.mixins import JsonDataResponseView, SuperuserRequiredMixin
from utils.mixins import JsonDataResponsePostView, SuperuserRequiredMixin
from utils.views import admin_required, expect_post, round_view

from .allocator import allocate_adjudicators
Expand Down Expand Up @@ -277,23 +277,23 @@ def get_context_data(self, **kwargs):
return super().get_context_data(**kwargs)


class CreateAutoAllocation(LogActionMixin, RoundMixin, SuperuserRequiredMixin, JsonDataResponseView):
class CreateAutoAllocation(LogActionMixin, RoundMixin, SuperuserRequiredMixin, JsonDataResponsePostView):

action_log_type = ActionLogEntry.ACTION_TYPE_ADJUDICATORS_AUTO

def get_data(self):
def post_data(self):
round = self.get_round()
allocate_adjudicators(round, HungarianAllocator)
return debates_to_json(round.debate_set_with_prefetches(), self.get_tournament(), round)

def get(self, request, *args, **kwargs):
def post(self, request, *args, **kwargs):
round = self.get_round()
if round.draw_status == Round.STATUS_RELEASED:
return HttpResponseBadRequest("Draw is already released, unrelease draw to redo auto-allocations.")
if round.draw_status != Round.STATUS_CONFIRMED:
return HttpResponseBadRequest("Draw is not confirmed, confirm draw to run auto-allocations.")
self.log_action()
return super().get(request, *args, **kwargs)
return super().post(request, *args, **kwargs)


class SaveDebateInfo(SuperuserRequiredMixin, RoundMixin, LogActionMixin, View):
Expand Down
11 changes: 9 additions & 2 deletions tabbycat/adjfeedback/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,15 @@ def choices_for_field(self):

@property
def choices_for_number_scale(self):
step = max((int(self.max_value) - int(self.min_value)) / 10, 1)
options = list(range(int(self.min_value), int(self.max_value + 1), int(step)))
return self.construct_number_scale(self.min_value, self.max_value)

def construct_number_scale(self, min_value, max_value):
print(min_value, max_value)
"""Used to build up a semi-intelligent range of options for numeric scales.
Shifted here rather than the class so it can be more easily used to
construct the default values for printed forms."""
step = max((int(max_value) - int(min_value)) / 10, 1)
options = list(range(int(min_value), int(max_value + 1), int(step)))
return options


Expand Down
2 changes: 2 additions & 0 deletions tabbycat/adjfeedback/templates/add_feedback.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
{% block head-title %}Who is the feedback from?{% endblock %}
{% block page-title %}Enter Feedback{% endblock %}

{% block page-subnav-actions %}{% endblock %}

{% block content %}
<div class="row">
<div class="col-md-6">
Expand Down
Loading

0 comments on commit 88c0235

Please sign in to comment.