Skip to content

Commit

Permalink
Merge pull request #403 from fast-aircraft-design/release-v1.2.1
Browse files Browse the repository at this point in the history
Release v1.2.1
  • Loading branch information
christophe-david committed Dec 9, 2021
2 parents 512ab41 + 0cbc983 commit 025dde5
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 84 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [ published ]

jobs:
delete-tag:
move-tag:
runs-on: ubuntu-latest
steps:
- name: Move tag
Expand All @@ -29,6 +29,16 @@ jobs:
sha: context.sha
})
build-binder-image:
needs: build-publish-package
runs-on: ubuntu-latest
steps:
- name: cache binder build on mybinder.org
uses: jupyterhub/repo2docker-action@master
with:
NO_PUSH: true
MYBINDERORG_TAG: latest-release

build-publish-package:
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -75,12 +85,3 @@ jobs:
poetry config pypi-token.pypi "$TOKEN"
poetry publish
build-binder-image:
needs: build-publish-package
runs-on: ubuntu-latest
steps:
- name: cache binder build on mybinder.org
uses: jupyterhub/repo2docker-action@master
with:
NO_PUSH: true
MYBINDERORG_TAG: latest-release
11 changes: 11 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
Changelog
=========

Version 1.2.1
=============
- Changes:
- Updated dependency requirements. All used libraries are now compatible with Jupyter lab 3 without need for building extensions. (#392)
- Now Atmosphere class is part of the [stdatm](https://pypi.org/project/stdatm/) package (#398)
- For `list_variables` command, the output format can now be chosen, with the addition of the format of variables_description.txt (for custom modules now generate a variable descriptions. (#399)

- Bug fixes:
- Minor fixes in Atmosphere class. (#386)


Version 1.1.2
=============
- Bug fixes:
Expand Down
3 changes: 2 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ cycler==0.10.0; python_version >= "3.7"
debugpy==1.5.0; python_version >= "3.7" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.7"
decorator==5.1.0; python_version >= "3.7"
defusedxml==0.7.1; python_version >= "3.5" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.5"
deprecated==1.2.13; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.4.0")
distlib==0.3.3; python_full_version >= "3.6.1"
docutils==0.17.1; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.5.0" and python_version >= "3.6"
ensure==1.0.0
Expand Down Expand Up @@ -144,6 +145,6 @@ webencodings==0.5.1; python_version >= "3.6" and python_full_version < "3.0.0" o
websocket-client==1.2.1; python_version >= "3.6"
widgetsnbextension==3.5.1; python_version >= "3.6"
wop==1.20.0; python_version >= "3.6"
wrapt==1.12.1; python_version >= "3.6" and python_version < "4.0"
wrapt==1.12.1; python_version >= "3.6" and python_full_version < "3.0.0" and python_version < "4.0" or python_version >= "3.6" and python_version < "4.0" and python_full_version >= "3.4.0"
xdsmjs==1.0.1; python_version >= "3.6"
zipp==3.6.0; python_version >= "3.6" and python_version < "3.8"
54 changes: 20 additions & 34 deletions poetry.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ jupyterlab = "^3.0.18"
jupyter-client = "!=7.0.0, !=7.0.1, !=7.0.2, !=7.0.3, !=7.0.4, !=7.0.5" # v7.0.6 fixes issue #381
notebook = "^6.0"
stdatm = "^0.1.0"
Deprecated = "^1.2.13"

[tool.poetry.dev-dependencies]
pytest = "^6.2"
Expand Down
3 changes: 2 additions & 1 deletion src/fastoad/cmd/fast.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import textwrap
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser, RawDescriptionHelpFormatter
from distutils.util import strtobool

import tabulate

import fastoad
Expand Down Expand Up @@ -177,7 +178,7 @@ def _notebooks(args):
print("")
print("Notebooks have been created in %s" % target_path)
print("You may now run Jupyter with:")
print(' jupyter notebook "%s"' % target_path)
print(' jupyter lab "%s"' % target_path)

# UTILITIES ====================================================================================

Expand Down
40 changes: 10 additions & 30 deletions src/fastoad/model_base/atmosphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
import warnings

from numbers import Number
from typing import Sequence, Union

import numpy as np
from deprecated import deprecated
from scipy.constants import R, atmosphere, foot

AIR_MOLAR_MASS = 28.9647e-3
Expand All @@ -27,27 +28,10 @@
TROPOPAUSE = 11000


def Atmosphere(*args, **kwargs):
warnings.warn(
"fastoad.model_base.Atmosphere is deprecated and will be removed in version 2.0 of "
"FAST-OAD. Please use stdatm.Atmosphere instead.",
DeprecationWarning,
stacklevel=2,
)
return AtmosphereOld(*args, **kwargs)


def AtmosphereSI(*args, **kwargs):
warnings.warn(
"fastoad.model_base.AtmosphereSI is deprecated and will be removed in version 2.0 of "
"FAST-OAD. Please use stdatm.AtmosphereSI instead.",
DeprecationWarning,
stacklevel=2,
)
return AtmosphereSIOld(*args, **kwargs)


class AtmosphereOld:
@deprecated(
version="1.2.0", reason="Will be removed in version 2.0. Please use stdatm.Atmosphere instead"
)
class Atmosphere:
"""
Simple implementation of International Standard Atmosphere
for troposphere and stratosphere.
Expand Down Expand Up @@ -87,13 +71,6 @@ def __init__(
:param altitude_in_feet: if True, altitude should be provided in feet. Otherwise,
it should be provided in meters.
"""
warnings.warn(
"fastoad.model_base.Atmosphere is deprecated and will be removed in version 2.0 of "
"FAST-OAD. Please use stdatm.Atmosphere instead.",
DeprecationWarning,
stacklevel=2,
)

self.delta_t = delta_t

# Floats will be provided as output if altitude is a scalar
Expand Down Expand Up @@ -270,7 +247,10 @@ def _return_value(self, value):
return value


class AtmosphereSIOld(AtmosphereOld):
@deprecated(
version="1.2.0", reason="Will be removed in version 2.0. Please use stdatm.AtmosphereSI instead"
)
class AtmosphereSI(Atmosphere):
"""Same as :class:`Atmosphere` except that altitudes are always in meters."""

def __init__(self, altitude: Union[float, Sequence[float]], delta_t: float = 0.0):
Expand Down
17 changes: 9 additions & 8 deletions src/fastoad/openmdao/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,15 @@ def read_variable_descriptions(cls, file_parent: str, update_existing: bool = Tr
variable_descriptions = None
description_file = None

if pth.isdir(file_parent):
file_path = pth.join(file_parent, DESCRIPTION_FILENAME)
if pth.isfile(file_path):
description_file = open(file_path)
else:
# Then it is a module name
if DESCRIPTION_FILENAME in contents(file_parent):
description_file = open_text(file_parent, DESCRIPTION_FILENAME)
if file_parent:
if pth.isdir(file_parent):
file_path = pth.join(file_parent, DESCRIPTION_FILENAME)
if pth.isfile(file_path):
description_file = open(file_path)
else:
# Then it is a module name
if DESCRIPTION_FILENAME in contents(file_parent):
description_file = open_text(file_parent, DESCRIPTION_FILENAME)

if description_file is not None:
try:
Expand Down

0 comments on commit 025dde5

Please sign in to comment.