Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Numpy 1.25+ #1623

Merged
merged 4 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
'cloudpickle>=2.1.0,<3.0',
'Faker>=10,<15',
'graphviz>=0.13.2,<1',
"numpy>=1.20.0,<1.25.0;python_version<'3.10'",
"numpy>=1.23.3,<1.25.0;python_version>='3.10'",
"numpy>=1.20.0,<2;python_version<'3.10'",
"numpy>=1.23.3,<2;python_version>='3.10'",
"pandas>=1.1.3;python_version<'3.10'",
"pandas>=1.3.4;python_version>='3.10' and python_version<'3.11'",
"pandas>=1.5.0;python_version>='3.11'",
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/evaluation/test_single_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ def test_evaluation():
data = pd.DataFrame({'col': [1, 2, 3]})
metadata = SingleTableMetadata()
metadata.add_column('col', sdtype='numerical')
synthesizer = GaussianCopulaSynthesizer(metadata)
synthesizer = GaussianCopulaSynthesizer(metadata, default_distribution='truncnorm')

# Run and Assert
synthesizer.fit(data)
samples = synthesizer.sample(10)
score = evaluate_quality(data, samples, metadata).get_score()
assert score == 0.8333333333333334
assert score == 0.8666666666666667

diagnostic = run_diagnostic(data, samples, metadata).get_results()
assert diagnostic == {
Expand Down
14 changes: 7 additions & 7 deletions tests/integration/single_table/test_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def test_scalar_range_constraint_with_datetimes_and_nones():
})

metadata.validate()
synth = GaussianCopulaSynthesizer(metadata)
synth = GaussianCopulaSynthesizer(metadata, default_distribution='truncnorm')
synth.add_constraints([
{
'constraint_class': 'ScalarRange',
Expand All @@ -555,26 +555,26 @@ def test_scalar_range_constraint_with_datetimes_and_nones():
# Assert
expected_sampled = pd.DataFrame({
'A': {
0: '2020-03-03',
0: '2020-02-04',
1: np.nan,
2: '2020-03-03',
2: '2020-02-07',
3: np.nan,
4: np.nan,
5: '2020-03-03',
5: '2020-02-29',
6: np.nan,
7: np.nan,
8: np.nan,
9: '2020-02-27',
9: '2020-02-02',
},
'B': {
0: np.nan,
1: np.nan,
2: np.nan,
3: np.nan,
4: np.nan,
5: '2021-04-14',
5: '2021-11-22',
6: np.nan,
7: '2021-05-21',
7: '2021-06-19',
8: np.nan,
9: np.nan,
}
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/single_table/test_copulas.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def test_numerical_columns_gets_pii():
'numerical': {'sdtype': 'numerical'}
}
})
synth = GaussianCopulaSynthesizer(metadata)
synth = GaussianCopulaSynthesizer(metadata, default_distribution='truncnorm')
synth.fit(data)

# Run
Expand All @@ -366,7 +366,7 @@ def test_numerical_columns_gets_pii():
8: 'Davidland',
9: 'Port Christopher'
},
'numerical': {0: 21, 1: 24, 2: 22, 3: 23, 4: 22, 5: 24, 6: 23, 7: 23, 8: 24, 9: 23}
'numerical': {0: 22, 1: 24, 2: 22, 3: 23, 4: 22, 5: 24, 6: 23, 7: 24, 8: 24, 9: 24}
})
pd.testing.assert_frame_equal(expected_sampled, sampled)

Expand Down
Loading