...
 
Commits (9)
IMAGE_TAG=0.24-beta
IMAGE_TAG=0.25-beta
......@@ -38,7 +38,6 @@ def upgrade():
sa.Column('band_code', sa.Integer(), nullable=True),
sa.Column('notes', sa.String(length=255), nullable=True),
sa.Column('bibcode', sa.String(length=19), nullable=True),
sa.Column('com', sa.String(length=255), nullable=True),
sa.PrimaryKeyConstraint('id', name=op.f('pk_star_info'))
)
op.create_table('submission',
......
......@@ -79,7 +79,6 @@ class StarInfo(Base):
'BANDCODE': { 'field': 'band_code', 'must': False, 'check': 'check_band_code' },
'NOTES': { 'field': 'notes', 'must': False },
'BIBCODE': { 'field': 'bibcode', 'must': True, 'check': 'check_bibcode', 'alternate': 'REFERENCE'},
'COM': { 'field': 'com', 'must': False, 'alternate': 'REFERENCE'},
'REFERENCE': { 'must': False, 'parse': 'parse_reference' },
'SINPE': {'field': 'sinpe', 'must': False, 'check': 'check_bool', 'parse': 'parse_sinpe'}, # SIMBAD Id Not Precise Enough
},
......@@ -130,7 +129,6 @@ class StarInfo(Base):
band_code = Column(Integer)
notes = Column(String(255))
bibcode = Column(String(19))
com = Column(String(255))
sinpe = Column(Boolean)
star_info_entry = relationship('StarInfoEntry', back_populates='star_info')
......@@ -205,7 +203,11 @@ class StarInfo(Base):
#
def is_unique(self):
q = self.session.query(StarInfo).filter_by(id1=self.id1, id2=self.id2, ud_diam=self.ud_diam, ld_diam=self.ld_diam, e_ld_diam=self.e_ld_diam).count()
# same id1, mesurements, bibcodes
q = self.session.query(StarInfo).filter_by(id1=self.id1, ud_diam=self.ud_diam, ld_diam=self.ld_diam, e_ld_diam=self.e_ld_diam, bibcode=self.bibcode).count()
print("is_unique query returns : %s"%q)
if q > 0:
self.append_entry_error('star entry already present in the catalog (same id1, ud_diam, ld_diam and bibcode)')
return not q
#
......@@ -417,7 +419,7 @@ class StarInfo(Base):
self.append_warning(field_name, "bibcode portion is incompletely specified")
self.set_field_value('bibcode', bibcode)
if comment:
self.set_field_value('com', comment)
self.append_warning('bibcode', 'bibcode extract ignore next part : %s'%comment)
# force parsing before checking since starname check depends on this field
def parse_sinpe(self, field_name, field_info, value):
......
......@@ -36,6 +36,6 @@
{% block content %}
<div>nothing to see here</div>
{% endblock content %}
<div class="footer"> <a href="https://www.jmmc.fr">JMMC</a> - 2019</div>
<div class="footer"> <a href="https://www.jmmc.fr">JMMC</a> </div>
</body>
</html>
......@@ -5,19 +5,18 @@
<table id="stars">
<thead>
<tr>
<th>id1</th>
<th>id2</th>
<th>ud_diam</th>
<th>ld_diam</th>
<th>e_ld_diam</th>
<th>band</th>
<th>mu_lambda</th>
<th>method</th>
<th>band_code</th>
<th>notes</th>
<th>bibcode</th>
<th>com</th>
<th>sinpe</th>
<th>ID1</th>
<th>ID2</th>
<th>UD_DIAM</th>
<th>LD_DIAM</th>
<th>E_LD_DIAM</th>
<th>BAND</th>
<th>MU_LAMBDA</th>
<th>METHOD</th>
<th>BANDCODE</th>
<th>NOTES</th>
<th>BIBCODE</th>
<th>SINPE</th>
</tr>
</thead>
<tbody>
......@@ -35,7 +34,6 @@
<td>{{star.band_code or '' }}</td>
<td>{{star.notes or '' }}</td>
<td>{{star.bibcode or '' }}</td>
<td>{{star.com or '' }}</td>
<td>{{star.sinpe or '' }}</td>
</tr>
{% endif %}
......
id1,id2,ud_diam,ld_diam,e_ld_diam,band,mu_lambda,method,band_code,notes,bibcode,com{% for star in stars %}{% if star.star_info_entry.0.validated%}{{star.id1 or ''}},{{star.id2 or ''}},{{star.ud_diam or ''}},{{star.ld_diam or ''}},{{star.e_ld_diam or ''}},{{star.band or ''}},{{star.mu_lambda or ''}},{{star.method or ''}},{{star.band_code or ''}},"{{star.notes or ''}}",{{star.bibcode or ''}},"{{star.com or ''}}","{{star.sinpe or ''}}"{% endif %}
ID1,ID2,UD_DIAM,LD_DIAM,E_LD_DIAM,BAND,MU_LAMBDA,METHOD,BANDCODE,NOTES,BIBCODE,SINPE{% for star in stars %}{% if star.star_info_entry.0.validated%}{{star.id1 or ''}},{{star.id2 or ''}},{{star.ud_diam or ''}},{{star.ld_diam or ''}},{{star.e_ld_diam or ''}},{{star.band or ''}},{{star.mu_lambda or ''}},{{star.method or ''}},{{star.band_code or ''}},"{{star.notes or ''}}",{{star.bibcode or ''}},"{{star.sinpe or ''}}"{% endif %}
{% endfor %}
......@@ -9,27 +9,26 @@
<thead>
<tr>
<th><button id="toggle-all">click all</button></th>
<th>line id</th>
<th>id1</th>
<th>id2</th>
<th>ud_diam</th>
<th>ld_diam</th>
<th>e_ld_diam</th>
<th>band</th>
<th>mu_lambda</th>
<th>method</th>
<th>band_code</th>
<th>notes</th>
<th>bibcode</th>
<th>com</th>
<th>sinpe</th>
<th>line number</th>
<th>ID1</th>
<th>ID2</th>
<th>UD_DIAM</th>
<th>LD_DIAM</th>
<th>E_LD_DIAM</th>
<th>BAND</th>
<th>MU_LAMBDA</th>
<th>METHOD</th>
<th>BAND_CODE</th>
<th>NOTES</th>
<th>BIBCODE</th>
<th>SINPE</th>
</tr>
</thead>
<tbody>
{% for entry in entries %}
<tr>
<td><input type="checkbox" name="valid[{{entry.star_info.id}}]" value="{{entry.star_info.id}}" {% if entry.validated %}checked="on"{% endif %}/></td>
<td>{{ entry.star_info.id or '' }}</td>
<td>{{ entry.line_number or '' }}</td>
<td><a href="http://simbad.u-strasbg.fr/simbad/sim-id?Ident={{ entry.star_info.id1 or '' }}">{{ entry.star_info.id1 or '' }}</a></td>
<td>{{ entry.star_info.id2 or '' }}</td>
<td>{{ entry.star_info.ud_diam or '' }}</td>
......@@ -41,7 +40,6 @@
<td>{{ entry.star_info.band_code or '' }}</td>
<td>{{ entry.star_info.notes or '' }}</td>
<td><a href="https://ui.adsabs.harvard.edu/abs/{{ entry.star_info.bibcode or '' }}/abstract">{{ entry.star_info.bibcode or '' }}</a></td>
<td>{{ entry.star_info.com or '' }}</td>
<td>{{ entry.star_info.sinpe or '' }}</td>
</tr>
<tr>
......
{% if entries %}
{% if has_problem %}
<a onclick="$(&quot;.erroronly&quot;).toggleClass(&quot;hidden&quot;);" class="dt-button"><span class="erroronly btn btn-warning btn-xs hidden">show all</span><span class="erroronly btn btn-success btn-xs">show error only</span></a>
{% endif %}
<div class="entry-info">
{% if has_problem %}
<a onclick="$(&quot;.erroronly&quot;).toggleClass(&quot;hidden&quot;);" class="dt-button"><span class="erroronly btn btn-warning btn-xs hidden">show all</span><span class="erroronly btn btn-success btn-xs">show error only</span></a>
{% endif %}
</div>
<div class="entry-info">
{% for entry in entries %}
{% if entry.entry.warnings or entry.entry.errors or entry.entry.unique %}
......
......@@ -39,22 +39,22 @@ class BaseTest(unittest.TestCase):
Base.metadata.drop_all(self.engine)
class TestMyViewSuccessCondition(BaseTest):
def setUp(self):
super(TestMyViewSuccessCondition, self).setUp()
self.init_database()
from .models import MyModel
model = MyModel(name='one', value=55)
self.session.add(model)
def test_passing_view(self):
from .views.default import my_view
info = my_view(dummy_request(self.session))
self.assertEqual(info['one'].name, 'one')
self.assertEqual(info['project'], 'jmdc-app')
# class TestMyViewSuccessCondition(BaseTest):
#
# def setUp(self):
# super(TestMyViewSuccessCondition, self).setUp()
# self.init_database()
#
# from .models import MyModel
#
# model = MyModel(name='one', value=55)
# self.session.add(model)
#
# def test_passing_view(self):
# from .views.default import my_view
# info = my_view(dummy_request(self.session))
# self.assertEqual(info['one'].name, 'one')
# self.assertEqual(info['project'], 'jmdc-app')
class TestMyViewFailureCondition(BaseTest):
......
......@@ -164,7 +164,7 @@ class import_new_data():
message = Message(subject="Hello, world!", sender=sender,
recipients=[self.sub.email],
body="If you didn't submit any data at JMMC, please ignore this message\n Else please confirm your submission visiting next url : \n %s \nRegards!"%verify_url)
print("DEBUG: sending test mail to %s url %s"%(self.sub.email, verify_url))
print("DEBUG: sending confirmation mail to %s with url : %s"%(self.sub.email, verify_url))
subject="JMMC - JMDC, please confirm your submission!"
body = "Hi,\n If you didn't submit any data at JMMC, please ignore this message\n"
body += "Else please confirm your submission visiting next url : \n %s \n" % verify_url
......