Esempio n. 1
0
def test_get_records_with_type():
    with fake_records():
        expected_result = [('fake_slug_metrics_1', 'metrics', {}),
                           ('fake_slug_metrics_2', 'metrics', {}),
                           ('fake_slug_hyperparams_1', 'hyperparams', {}),
                           ('fake_slug_hyperparams_2', 'hyperparams', {})]
        assert get_records() == expected_result
Esempio n. 2
0
    def test_get_records_without_type(self):
        expected_result = [
            'fake_slug_metrics_1', 'fake_slug_metrics_2',
            'fake_slug_hyperparams_1', 'fake_slug_hyperparams_2'
        ]

        self.assertEqual(get_records(slug_only=True), expected_result)
Esempio n. 3
0
def test_get_records_without_type():
    with fake_records():
        expected_result = [
            'fake_slug_metrics_1', 'fake_slug_metrics_2',
            'fake_slug_hyperparams_1', 'fake_slug_hyperparams_2'
        ]

        assert get_records(slug_only=True) == expected_result
Esempio n. 4
0
def _attach_records(gist_slug, version):
    """Attached records to the current commit"""
    tracking_slugs = get_records(slug_only=True)
    if len(tracking_slugs) > 0:
        log('Attaching records (metrics, hyperparameters, dataset etc.)')
        api.post_records(gist_slug, tracking_slugs, version)
Esempio n. 5
0
 def test_get_records_with_type(self):
     expected_result = [('fake_slug_metrics_1', 'metrics', {}),
                        ('fake_slug_metrics_2', 'metrics', {}),
                        ('fake_slug_hyperparams_1', 'hyperparams', {}),
                        ('fake_slug_hyperparams_2', 'hyperparams', {})]
     self.assertEqual(get_records(), expected_result)