Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhsmit committed Jun 10, 2021
1 parent 68624c4 commit e0af1cb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions pyhdx/fitting_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def output(self):
#data_obj is HDXMeasurementset

quantities = ['sequence', '_deltaG', 'deltaG', 'covariance', 'pfact']
names = [hdxm.name or hdxm.state for hdxm in self.data_obj.hdxm_list]
names = [hdxm.name for hdxm in self.data_obj.hdxm_list]
iterables = [names, quantities]
col_index = pd.MultiIndex.from_product(iterables, names=['State', 'Quantity'])
df = pd.DataFrame(index=self.data_obj.r_number, columns=col_index)
Expand All @@ -184,5 +184,4 @@ def output(self):
cov_series = cov['covariance'].reindex(df.index)
df[hdxm.name, 'covariance'] = cov_series


return Protein(df)
2 changes: 1 addition & 1 deletion pyhdx/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ def __init__(self, data, **metadata):

@property
def name(self):
return self.metadata.get('name', None)
return self.metadata.get('name', self.state)

@property
def temperature(self):
Expand Down
4 changes: 1 addition & 3 deletions tests/test_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
from pyhdx.models import HDXMeasurementSet
import numpy as np
import torch
import pandas as pd
import time
from dask.distributed import LocalCluster
import asyncio

directory = os.path.dirname(__file__)
np.random.seed(43)
Expand Down Expand Up @@ -78,7 +76,7 @@ def test_batch_fit(self):

for state in states:
from pandas.testing import assert_series_equal
#

result = output[state]['deltaG']
test = check_protein[state]['deltaG']

Expand Down

0 comments on commit e0af1cb

Please sign in to comment.