diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 43bd071..bd9ba48 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,11 +16,12 @@ jobs: with: toxdeps: tox-pypi-filter envs: | - - macos: py311 - - windows: py311 - - linux: py39 + - macos: py312 + - windows: py312 - linux: py310 - linux: py311 + - linux: py312 + - linux: py313 coverage: 'codecov' secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} @@ -38,7 +39,7 @@ jobs: toxdeps: tox-pypi-filter envs: | - linux: build_docs - python-version: '3.11' + python-version: '3.12' publish: # Build wheels when pushing to any branch except main # publish.yml will only publish if tagged ^v.* @@ -58,6 +59,6 @@ jobs: test_extras: 'dev' test_command: 'pytest -p no:warnings --doctest-rst --pyargs pydrad' submodules: false - python-version: '3.11' + python-version: '3.12' secrets: pypi_token: ${{ secrets.PYPI_TOKEN }} diff --git a/pydrad/configure/configure.py b/pydrad/configure/configure.py index 2823de7..186a765 100644 --- a/pydrad/configure/configure.py +++ b/pydrad/configure/configure.py @@ -202,7 +202,7 @@ def date(self): if hasattr(self, '_freeze_date') and self._freeze_date: return self._date else: - return datetime.datetime.now(datetime.UTC).strftime('%Y-%m-%d_%H.%M.%S UTC') + return datetime.datetime.utcnow().strftime('%Y-%m-%d_%H.%M.%S UTC') @property def templates(self,): @@ -405,7 +405,7 @@ def minimum_cells(self): n_min = L / self.config['grid']['maximum_cell_width'] if n_min.decompose().unit != u.dimensionless_unscaled: raise u.UnitConversionError(f'''Maximum cell width must be able to be converted to {L.unit}''') - return int(np.round(n_min.decompose())) + return int(np.ceil(n_min.decompose())) @property def maximum_cells(self): diff --git a/pydrad/configure/data/defaults.asdf b/pydrad/configure/data/defaults.asdf index edc5ebe..9b73bde 100644 --- a/pydrad/configure/data/defaults.asdf +++ b/pydrad/configure/data/defaults.asdf @@ -37,6 +37,7 @@ grid: enforce_conservation: true initial_refinement_level: 10 linear_restriction: true + maximum_cells: 30000 maximum_cell_width: !unit/quantity-1.1.0 {unit: !unit/unit-1.0.0 'Mm', value: 0.5} maximum_fractional_difference: 0.2 maximum_refinement_level: 12 diff --git a/pydrad/configure/templates/initial_conditions.cfg b/pydrad/configure/templates/initial_conditions.cfg index e9bb5eb..2b54263 100644 --- a/pydrad/configure/templates/initial_conditions.cfg +++ b/pydrad/configure/templates/initial_conditions.cfg @@ -1,6 +1,6 @@ Initial_Conditions/profiles/initial.amr -{{ general.loop_length | is_required | units_filter('cm') | sci_notation }} +{{ general.loop_length | is_required | units_filter('cm') | sci_notation(sig_figs=4) }} {{ general.loop_inclination | is_required | units_filter('deg') }} {{ general.footpoint_height | is_required | units_filter('cm') | sci_notation }} diff --git a/pydrad/configure/tests/test_templates.py b/pydrad/configure/tests/test_templates.py index fe073ae..3149cc7 100644 --- a/pydrad/configure/tests/test_templates.py +++ b/pydrad/configure/tests/test_templates.py @@ -316,7 +316,7 @@ def test_initial_conditions_config(configuration): # Isothermal case config = f"""Initial_Conditions/profiles/initial.amr -9.00000000e+09 +9.0000e+09 0.0 5.00000000e+08 @@ -341,7 +341,7 @@ def test_initial_conditions_config(configuration): configuration.config['initial_conditions']['heating_range_fine_tuning'] = 10000 config = f"""Initial_Conditions/profiles/initial.amr -9.00000000e+09 +9.0000e+09 0.0 5.00000000e+08 diff --git a/setup.cfg b/setup.cfg index ad9c6d2..1aec17c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,16 +15,16 @@ classifiers = License :: OSI Approved :: MIT License Programming Language :: Python Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 + Programming Language :: Python :: 3.13 Topic :: Scientific/Engineering :: Astronomy [options] zip_safe = False packages = find: -python_requires = >=3.9 +python_requires = >=3.10 setup_requires = setuptools_scm install_requires = scipy @@ -65,6 +65,7 @@ filterwarnings = # See https://github.com/numpy/numpy/issues/15748#issuecomment-598584838 ignore:numpy.ndarray size changed:RuntimeWarning ignore:The unit 'erg' has been deprecated in the VOUnit standard.:astropy.units.core.UnitsWarning + ignore:datetime.datetime.utcnow\(\) is deprecated and scheduled for removal in a future version.:DeprecationWarning [coverage:run] omit = diff --git a/tox.ini b/tox.ini index ba30824..ac458a3 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{39,310,311} + py{310,311,312,313} build_docs codestyle isolated_build = true