Skip to content

Commit

Permalink
Fix acoustic exports
Browse files Browse the repository at this point in the history
Update documentation for apache config as well
  • Loading branch information
mmcauliffe committed Jul 8, 2019
1 parent 84d12ec commit beabd6b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 16 deletions.
14 changes: 9 additions & 5 deletions docs/source/apache_setup.rst
Expand Up @@ -45,7 +45,8 @@ would be saved to a file named ``roquefort.linguistics.mcgill.ca.conf`` in ``/et
<VirtualHost *:80>
ServerName roquefort.linguistics.mcgill.ca # Update for other hostname
# Update for other hostname
ServerName roquefort.linguistics.mcgill.ca
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
Expand All @@ -54,7 +55,8 @@ would be saved to a file named ``roquefort.linguistics.mcgill.ca.conf`` in ``/et
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =roquefort.linguistics.mcgill.ca # Update for other hostname
# Update for other hostname
RewriteCond %{SERVER_NAME} =roquefort.linguistics.mcgill.ca
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
Expand All @@ -76,16 +78,18 @@ would be saved to a file named ``roquefort.linguistics.mcgill.ca-ssl.conf`` in `
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName roquefort.linguistics.mcgill.ca # Update for other hostname
# Update for other hostname
ServerName roquefort.linguistics.mcgill.ca
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/letsencrypt/live/roquefort.linguistics.mcgill.ca/fullchain.pem # Update for actual location
SSLCertificateKeyFile /etc/letsencrypt/live/roquefort.linguistics.mcgill.ca/privkey.pem # Update for actual location
# Update for actual location
SSLCertificateFile /etc/letsencrypt/live/roquefort.linguistics.mcgill.ca/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/roquefort.linguistics.mcgill.ca/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
<Location "/">
Expand Down
23 changes: 16 additions & 7 deletions iscan/models.py
Expand Up @@ -1188,6 +1188,7 @@ def generate_query_for_export(self, corpus_context):
config = self.config
a = getattr(corpus_context, a_type)
acoustic_columns = config.get('acoustic_columns', {})
acoustic_tracks = config.get('acoustic_tracks', {})
columns = config.get('columns', {})
column_names = config.get('column_names', {})
q = self.generate_base_query(corpus_context)
Expand Down Expand Up @@ -1238,7 +1239,22 @@ def generate_query_for_export(self, corpus_context):
pass
q = q.columns(att)

print(acoustic_columns)
for a_column, props in acoustic_columns.items():
if a_column not in corpus_context.hierarchy.acoustics:
continue
relative_aggregate = props.pop('relative', False)
acoustic = getattr(a, a_column)
acoustic.relative = relative_aggregate
for c, v in props.items():
if not v:
continue
if c not in ['mean', 'stdev', 'median', 'max', 'min']:
continue
q = q.columns(getattr(acoustic, c))

print(acoustic_tracks)
for a_column, props in acoustic_tracks.items():
# track props
include_track = props.pop('include', False)
if not include_track:
Expand All @@ -1247,13 +1263,6 @@ def generate_query_for_export(self, corpus_context):
relative_track = props.pop('relative_track', False)
num_points = props.pop('num_points', '')

relative_aggregate = props.pop('relative_aggregate', False)
acoustic = getattr(a, a_column)
acoustic.relative = relative_aggregate
for c, v in props.items():
if not v:
continue
q = q.columns(getattr(acoustic, c))
if include_track:
acoustic = getattr(a, a_column)
acoustic.relative_time = relative_time
Expand Down
8 changes: 4 additions & 4 deletions iscan/static/iscan/query/query.html
Expand Up @@ -696,21 +696,21 @@ <h3>Exporting acoustic measures</h3>
<md-card-content>

<div>
<md-checkbox ng-model="query.acoustic_columns[acoustic].include" aria-label="Include track">Include track
<md-checkbox ng-model="query.acoustic_tracks[acoustic].include" aria-label="Include track">Include track
</md-checkbox>
</div>
<div>
<md-checkbox ng-model="query.acoustic_columns[acoustic].relative_track" aria-label="Include relativized">
<md-checkbox ng-model="query.acoustic_tracks[acoustic].relative_track" aria-label="Include relativized">
Include relativized
</md-checkbox>
</div>
<div>
<md-checkbox ng-model="query.acoustic_columns[acoustic].relative_time" aria-label="Relative time">
<md-checkbox ng-model="query.acoustic_tracks[acoustic].relative_time" aria-label="Relative time">
Relative time
</md-checkbox>
</div>
<div>
<input type="number" ng-model="query.acoustic_columns[acoustic].num_points"
<input type="number" ng-model="query.acoustic_tracks[acoustic].num_points"
style="max-width:35px;">
<span>Interpolation points</span>
</div>
Expand Down
4 changes: 4 additions & 0 deletions iscan/static/iscan/query/query.js
Expand Up @@ -441,6 +441,10 @@ angular.module('query', [
speaker: {}
},
acoustic_columns: {
pitch: {},
formants: {}
},
acoustic_tracks: {
pitch: {include: false},
formants: {include: false}
}
Expand Down

0 comments on commit beabd6b

Please sign in to comment.